単純な暗号解読

841 ワード



//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);
}