Using System;
Using System. Text;
Using System. Globalization;
Using System. Security. Cryptography;
Using System. Windows. Forms;
Namespace encryption. Encrypts
{
Public class JhEncrypt
{
/// <Summary>
/// Constructor
/// </Summary>
Public JhEncrypt ()
{
}
/// <Summary>
/// Use the default key string for encryption
/// </Summary>
/// <Param name = "original"> plaintext </param>
/// <Returns> ciphertext </returns>
Public static string Encrypt (string original)
{
Return Encrypt (original, "JASONHEUNG ");
}
/// <Summary>
/// Use the default key for decryption
/// </Summary>
/// <Param name = "original"> ciphertext </param>
/// <Returns> plaintext </returns>
Public static string Decrypt (string original)
{
Return Decrypt (original, "JASONHEUNG", System. Text. Encoding. Default );
}
/// <Summary>
/// Decrypt with the given key
/// </Summary>
/// <Param name = "original"> ciphertext </param>
/// <Param name = "key"> key </param>
/// <Returns> plaintext </returns>
Public static string Decrypt (string original, string key)
{
Return Decrypt (original, key, System. Text. Encoding. Default );
}
/// <Summary>
/// Use the default key for decryption and return the plaintext of the specified encoding method
/// </Summary>
/// <Param name = "original"> ciphertext </param>