简单的加密解密
程序员文章站
2022-04-02 16:09:01
...
//C# //加密,按UTF8加密,安卓才能解析 private string BBEncrypt(string password) { password = "H" + password + "K"; byte[] bytes = new UTF8Encoding().GetBytes(password); return Convert.ToBase64String(bytes); } //解密 private string BBDecrypt(string strEncrypt) { byte[] bytes2 = Convert.FromBase64String(strEncrypt); return new UTF8Encoding().GetString(bytes2); } //Android // 加密,安卓是按UTF8加密的 String encode(String mima) { byte[] _tmp = Base64.encode(mima.getBytes(), Base64.DEFAULT); return new String(_tmp); } // 解密,安卓是按UTF8解密的 String decode(String mima) { byte[] _tmp = Base64.decode(mima, Base64.DEFAULT); return new String(_tmp); }
上一篇: 比较全面的CURL函数库中文说明
下一篇: 避免PHP-FPM内存泄漏导致内存耗尽