C#加密库 Elixis

码农软件 · 软件分类 · 加密/解密软件包 · 2019-10-01 09:27:42

软件介绍

Elixis 是一个C#的加密啊库,支持 AES、TripleDES和MD5 算法的加密和解密(MD5是单向的),而且更多加密的算法还在进一步开发中。

示例代码:

private static AESEncryptor fAESEncryptor = new AESEncryptor("My Password", AESBits.BITS256);
private static TripleDESEncryptor fTripleDESEncryptor = new TripleDESEncryptor("My Password");
private static MD5Encryptor fMD5Encryptor = new MD5Encryptor();
 
static void Main(string[] args)
{
    string originalText = "Hello! This is Elixis...";
 
    Console.WriteLine("AES Encryption n ");
 
    // Encrypt with AES.
    string encryptedAESString = fAESEncryptor.Encrypt(originalText);
    Console.WriteLine("Encrypted AES: " + encryptedAESString);
 
    // Decrypt with AES.
    string decryptedAESString = fAESEncryptor.Decrypt(encryptedAESString);
    Console.WriteLine("Decrypted AES: " + decryptedAESString);
 
    Console.WriteLine("nnTripleDES Encryption n ");
 
    // Encrypt with TripleDES.
    byte[] tripleDESEncryptedString = fTripleDESEncryptor.Encrypt(Encoding.ASCII.GetBytes(originalText));
    Console.WriteLine("Encrypted TripleDES: " + Encoding.Default.GetString(tripleDESEncryptedString));
 
    // Decrypt with TripleDES.
    byte[] tripleDESDecryptedString = fTripleDESEncryptor.Decrypt(tripleDESEncryptedString);
    Console.WriteLine("Decrypted TripleDES: " + Encoding.Default.GetString(tripleDESDecryptedString));
 
    Console.WriteLine("nnMD5 Encryption n ");
 
    // Encrypt with MD5.
    string md5 = fMD5Encryptor.GetMD5(originalText);
    Console.WriteLine("MD5: " + md5);
 
    string md5_bytes = fMD5Encryptor.GetMD5(Encoding.ASCII.GetBytes(originalText));
    Console.WriteLine("MD5_bytes: " + md5_bytes);
 
    Console.Read();
}

本文地址:https://www.codercto.com/soft/d/15786.html

Single Page Web Applications

Single Page Web Applications

Michael Mikowski、Josh Powell / Manning Publications / 2013-9-30 / USD 44.99

Code for most web sites mostly runs on the server. When a user clicks on a link, the site reacts slowly because the browser sends information to the server and the server sends it back again before di......一起来看看 《Single Page Web Applications》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

在线进制转换器
在线进制转换器

各进制数互转换器