java - JNI 字符串处理乱码问题jstring to char
阿神
阿神 2017-04-18 10:13:56
0
2
343
阿神
阿神

闭关修行中......

reply all(2)
洪涛
  1. strcmp(key_string, key_str) returns 0;

  2. strlen(key_string)=13, sizeof(key_string)=4

  3. strlen(key_str)=13, sizeof(key_str)=4
    These three items indicate that your key_str and key_string are exactly the same.

I suspect this is the problem here
AES_set_encrypt_key(key_string, 256, &key);
Because your key is only 13 bytes long, even 13*8 is only 104 bits, so the 256 you passed is probably accessed out of bounds. Determined data
It is because of this uncertain data that the keys are different during encryption and decryption, so the decryption is garbled.

洪涛

Pump it up, don’t sink it!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template