|
| 1 | +# SafeCrypt Library |
| 2 | + |
| 3 | +A C# library for encryption and decryption. |
| 4 | + |
| 5 | +## Overview |
| 6 | + |
| 7 | +The Encryption library provides a set of methods for encrypting and decrypting data using the Advanced Encryption Standard (AES) algorithm, and other algorithm. It is designed to be easy to use and can be integrated into C# applications that require secure data transmission or storage. |
| 8 | + |
| 9 | +## Table of Contents |
| 10 | + |
| 11 | +- [Installation](#installation) |
| 12 | +- [Usage](#usage) |
| 13 | +- [API Reference](#api-reference) |
| 14 | +- [Examples](#examples) |
| 15 | +- [Contributing](#contributing) |
| 16 | +- [License](#license) |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +To use the SafeCrypt library in your C# project, follow these steps: |
| 21 | + |
| 22 | +1. Clone the repository: |
| 23 | + |
| 24 | + ```bash |
| 25 | + git clone https://github.com/selfmadecode/SafeCrypt |
| 26 | + cd SafeCrypt |
| 27 | + ``` |
| 28 | + |
| 29 | +2. Build the project: |
| 30 | + |
| 31 | + ```bash |
| 32 | + dotnet build |
| 33 | + ``` |
| 34 | + |
| 35 | +Now, you can reference the SafeCrypt library in your C# project. |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +To use the library in your C# application, instantiate the `SafeCrypt` class and call the provided methods. Here's a simple example: |
| 40 | + |
| 41 | +```csharp |
| 42 | +using SafeCrypt; |
| 43 | + |
| 44 | +class Program |
| 45 | +{ |
| 46 | + static void Main() |
| 47 | + { |
| 48 | + var aesEncryptor = new AesEncryption(); |
| 49 | + var encryptedData = aesEncryptor.AesEncrypt("Hello, World!", "mySecretKey"); |
| 50 | + Console.WriteLine($"Encrypted Data: {encryptedData.Data}"); |
| 51 | + Console.WriteLine($"Initialization Vector: {encryptedData.Iv}"); |
| 52 | + } |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +## API Reference |
| 57 | + |
| 58 | +### `AesEncryption` |
| 59 | + |
| 60 | +- `AesEncrypt(byte[] data, byte[] secretKey, byte[] iv): byte[]` |
| 61 | + - Encrypts a byte array using AES algorithm. |
| 62 | + - Parameters: |
| 63 | + - `data`: The data to encrypt. |
| 64 | + - `secretKey`: The secret key for encryption. |
| 65 | + - `iv`: The initialization vector for encryption. |
| 66 | + - Returns: The encrypted data. |
| 67 | + |
| 68 | +## Examples |
| 69 | + |
| 70 | +### Encrypting a String |
| 71 | + |
| 72 | +```csharp |
| 73 | +var aesEncryptor = new AesEncryption(); |
| 74 | +var encryptionData = aesEncryptor.AesEncrypt("Hello, World!", "mySecretKey"); |
| 75 | +Console.WriteLine($"Encrypted Data: {encryptionData.Data}"); |
| 76 | +Console.WriteLine($"Initialization Vector: {encryptionData.Iv}"); |
| 77 | +``` |
| 78 | + |
| 79 | +## Contributing |
| 80 | + |
| 81 | +If you would like to contribute to the development of the SafeCrypt library, follow these steps: |
| 82 | + |
| 83 | +1. Create an issue to discuss the proposed changes or bug fixes. |
| 84 | +2. Fork the repository and create a new branch for your work: |
| 85 | + |
| 86 | + ```bash |
| 87 | + git checkout -b feature/my-feature |
| 88 | + ``` |
| 89 | + |
| 90 | +3. Make your changes and commit them with clear and concise messages. |
| 91 | +4. Push your changes to your fork. |
| 92 | +5. Create a pull request from your branch to the main repository. |
| 93 | +6. Ensure that your pull request follows the contribution guidelines and includes necessary tests. |
| 94 | + |
| 95 | +## License |
| 96 | + |
| 97 | +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. |
0 commit comments