If the value is exceeded by an encrypted value (using seed128 cbckisa open source) on the web, we will try to decrypt it with c.
Java Side
private static byte pbUserKey[] = StringUtil.StringToByteLength("indexUserKey", 16);
private static byte bszIV[] = StringUtil.StringToByteLength("indexVectorKey", 16);
private static String seed_utf = "utf-8";
byte[] enc_nt = null;
String str;
enc_nt = SEED_CBC_Encrypt(pbUserKey, bszIV, str.getBytes(seed_utf ), 0, str.getBytes(seed_utf ).length);
byte[] dec_nt = null;
dec = SEED_CBC_Decrypt(pbUserKey, bszIV, enc_nt , 0, enc_nt .length);
How should I receive it from page c?
private static byte pbUserKey[] = StringUtil.StringToByteLength("indexUserKey", 16);
//--> BYTE pbUserKey[] = I wonder how to get the top back.
enc_nt = SEED_CBC_Encrypt(pbUserKey, bszIV, str.getBytes(seed_utf), 0, str.getBytes(seed_utf).length);
How should str.getBytes(seed_utf)
be received from c above? And .Also length
.
I did it like below, but it didn't work.
enc_nt = SEED_CBC_Encrypt(pbszUserKey, pbszIV, seed_utf , 0, strlen(seed_utf ));
dec_nt = SEED_CBC_Decrypt(pbUserKey, bszIV, enc_nt , 0, strlen(enc_nt ));
Please answer me.
c++ c
Java uses Unicode (utf16be).
In other words, wcslen should be used instead of the ansi tolerance strlen.
If it's communication between Java and c, you have to pay attention to encoding.
Java has fewer side effects due to os, but c should also pay attention to os settings.
GetBytes is literally converting to an array of bytes for encryption/decryption.
Length is to find the length of the array.
Receive an encrypted string from c and test it first
If there is no problem with encryption/decryption tests in c, consider sending data between Java <-> c.
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
547 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
702 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
532 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.