首页 > Web开发 > 详细

11 在.NET 中如何加密和解密一个字符串

时间:2014-06-24 20:35:33      阅读:375      评论:0      收藏:0      [点我收藏+]
        string plainText = "This is plain text that we will encrypt";
        string password = "P@$$w0rd";

        Console.WriteLine(plainText);
        Console.WriteLine();
            
        create a new instance of our encryption class passing in the password as the key
        DESEncrypt testEncrypt = new DESEncrypt();

        string encText = testEncrypt.EncryptString(plainText, password);
        Console.WriteLine("****** Encrypted text ******");
        Console.WriteLine(encText);
        Console.WriteLine();

        Console.WriteLine("****** Decrypted text ******");
        string plain = testEncrypt.DecryptString(encText, password);
        Console.WriteLine(plain);
        Console.WriteLine();



此处省去去多行。。。

11 在.NET 中如何加密和解密一个字符串,布布扣,bubuko.com

11 在.NET 中如何加密和解密一个字符串

原文:http://blog.csdn.net/u011685627/article/details/33466413

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!