Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

urgent help! does anyone has sample code to do encry in c & decry in java

843810Aug 28 2003 — edited Aug 28 2003
Does anyone has a very simple code to encrypt a string in c (openssl for example) and then decrypt the same string in java?

it should be very simple but i just can get the ball rolling. i always get different data (even in hex string representation) using the same key and plain text (all in hex) to even just do encryption (not even decryption yet). To my understanding, DES is just bits manipulation. So the output bit pattern should be the same regardless C or Java, right?

for example, in openssl, when i do ecb:

the key:
0123456789ABCDEF
the plain text:
0101010101010101
the in:
0101010101010101
the out:
B4FD231647A5BEC0

but doing the same in java i got

3A2EAD12F475D82C as the encryption output

It is very strange.

Hope someone could help me.
Thanks
-- Jin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2003
Added on Aug 28 2003
3 comments
324 views