Encryption | decryption
[DllImport ("Des64.dll")]
private static extern void B64_des (StringBuilder in_str, StringBuilder out_str, string key, int lenth, uint option);
The first parameter is the string you want to decrypt, the second argument is the string to output, the third is the specified argument, the fourth is the string length, and the last is the encryption and decryption parameter. 0 Encryption 1 decryption.
[DllImport ("Des64.dll")]
private static extern int b64_size (int lenth, uint option);
<summary>
<param name= "M_str" ></param>
<param name= "M_key" ></param>
<param name= "Flag" ></param>
<returns></returns>
</summary>
public static string Keyornokey (String m_str,string m_key,uint flag)
{
int outlen = b64_size (m_str.length, flag);
StringBuilder result = new StringBuilder (0xff);
result.capacity = Outlen;
Result.length = Outlen;
StringBuilder Source = new StringBuilder (M_STR);
B64_des (Source, Result,m_key, m_str.length, flag);
string s = result.tostring (). Trim ();
Return result.tostring (). Trim ();
}
Here's a place to pay attention to. That's why we use StringBuilder. Because that parameter is variable.