Crypt Class
Last updated
Was this helpful?
Last updated
Was this helpful?
The Crypt
class is a part of the Chase CommonLib library developed by LFInteractive LLC. This class is designed for encrypting and decrypting strings and files using the AES encryption algorithm. It provides methods to encrypt and decrypt data and allows you to specify a custom salt for added security.
The Crypt
class is licensed under the .
A class for encrypting and decrypting strings and files using the AES encryption algorithm.
Crypt()
Creates a new instance of the Crypt
class with a random salt based on the current machine.
Crypt(string salt)
Creates a new instance of the Crypt
class with the specified salt.
salt
: A custom salt value used for encryption and decryption.
Salt
Gets or sets the salt used for encryption and decryption.
Encrypt(string text)
Encrypts the specified text using AES encryption.
text
: The text to be encrypted.
Returns the encrypted text as a Base64-encoded string.
Encrypt(string path, string output)
Encrypts the content of a file and writes the encrypted data to an output file.
path
: The path to the input file.
output
: The path to the output file where the encrypted data will be written.
Decrypt(string path, string output)
Decrypts the content of a file and writes the decrypted data to an output file.
path
: The path to the input file containing encrypted data.
output
: The path to the output file where the decrypted data will be written.
Decrypt(string text)
Decrypts the specified Base64-encoded text using AES decryption.
text
: The Base64-encoded text to be decrypted.
Returns the decrypted text.
GetSaltBytes()
Gets the salt bytes derived from the Salt
property.
This documentation provides an overview of the Crypt
class, its constructor, properties, methods, and includes example code demonstrating how to use it for text and file encryption and decryption.