EncryptionHelper (VB.NET)

A comprehensive guide to the EncryptionHelper (VB.NET)

EncryptionHelper (VB.NET)

A comprehensive utility class for data encryption and decryption operations, supporting multiple encryption algorithms and standards.

Features

Installation

Add the EncryptionHelper.vb file to your project.

Imports JVR.Helpers

Usage Examples

Symmetric Encryption

Dim encryption As New EncryptionHelper()

' Encrypt data
Dim plainText As String = "Sensitive data"
Dim key As Byte() = encryption.GenerateAesKey()
Dim iv As Byte() = encryption.GenerateIV()
Dim encrypted As Byte() = encryption.EncryptAes(plainText, key, iv)

' Decrypt data
Dim decrypted As String = encryption.DecryptAes(encrypted, key, iv)

Asymmetric Encryption

Dim encryption As New EncryptionHelper()

' Generate key pair
Dim keyPair = encryption.GenerateRsaKeyPair()

' Encrypt with public key
Dim plainText As String = "Sensitive data"
Dim encrypted As Byte() = encryption.EncryptRsa(plainText, keyPair.PublicKey)

' Decrypt with private key
Dim decrypted As String = encryption.DecryptRsa(encrypted, keyPair.PrivateKey)

Password-Based Encryption

Dim encryption As New EncryptionHelper()

' Encrypt with password
Dim plainText As String = "Sensitive data"
Dim password As String = "MySecurePassword"
Dim encrypted As Byte() = encryption.EncryptWithPassword(plainText, password)

' Decrypt with password
Dim decrypted As String = encryption.DecryptWithPassword(encrypted, password)

API Reference

Symmetric Encryption

Asymmetric Encryption

Password-Based Encryption

Key Management

Security Features

Dependencies

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

Version History

Legal Disclaimer

This documentation and associated helper scripts are provided "as is" without warranty of any kind, either express or implied.

  1. The code examples and helper functions are for illustrative purposes only.
  2. Users should thoroughly test any implementation in their specific environment.
  3. The authors are not responsible for any issues or damages arising from the use of these scripts.
  4. Always follow security best practices and your organization's coding guidelines.