웹에서 암호화된 값으로(seed128 cbckisa open source 사용)로 값이 넘어오면 c로 복호화(decription)을 해주려고합니다.
자바쪽
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);
c쪽에서 어떻게 받아야할까요 ?
private static byte pbUserKey[] = StringUtil.StringToByteLength("indexUserKey", 16);
//--> BYTE pbUserKey[] = 위쪽 뒤를 어떻게 받아야 하는지 궁금합니다.
enc_nt = SEED_CBC_Encrypt(pbUserKey, bszIV, str.getBytes(seed_utf), 0, str.getBytes(seed_utf).length);
위에서 str.getBytes(seed_utf)
는 c에서 어떻게 받아야할까요? 그리고 .length
도요.
아래처럼 했는데 안되서요.
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 ));
답변부탁드립니다.