编码和加密之间有什么区别? [英] What is the different between encode and encription?

查看:80
本文介绍了编码和加密之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想在C#中使用非常好的加密和解密算法?

我用Google搜索了某个页面,..我得到了一个...

hi all,

I wanna very good encryption and decryption algorithm in c#?.

I googled Some page,.. I got one,..

private string base64Encode(string sData)
          {
              try
              {
                  byte[] encData_byte = new byte[sData.Length];
                  encData_byte = System.Text.Encoding.UTF8.GetBytes(sData);
                  string encodedData = Convert.ToBase64String(encData_byte);
                  return encodedData;
              }
              catch (Exception ex)
              {
                  throw new Exception("Error in base64Encode" + ex.Message);
              }
          }





public string base64Decode(string sData)
           {
               System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
               System.Text.Decoder utf8Decode = encoder.GetDecoder();
               byte[] todecode_byte = Convert.FromBase64String(sData);
               int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
               char[] decoded_char = new char[charCount];
               utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
               string result = new String(decoded_char);
               return result;
           }



好吗?.否则建议一个好人.


编码和加密有什么区别?



Is it good?. else suggest a good one.


and What is the different between encode and encription?

thanks in advance!.

推荐答案

编码未加密:

http://www.di-mgt.com.au/encode_encrypt.html [ ^ ]
Encoding is NOT encryption:

http://www.di-mgt.com.au/encode_encrypt.html[^]


编码和加密之间的区别 [

这篇关于编码和加密之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆