Great News! JavaCardOS WIKI has new appearance and features.

In new WIKI, you can comment any page, edit any page and even create new item to share your knowledge with us.

Let's build the most comprehensive and powerful knowledge base of java card! Looking forward to your joining!

cipher/ decipher with 3DES alg

Algorithm School

Moderator: UNKNwYSHSA

Ruenie
Posts: 12
Joined: Tue Feb 16, 2016 10:02 pm
Points: 135
Contact:

cipher/ decipher with 3DES alg

Postby Ruenie » Wed Apr 26, 2017 11:46 pm

Hey guys,

I came across a problem recently. Hope you can figure me out.

I tried to cipher some text with 3DES alg with a key of 16 bytes. And I asked users to input the first part of my 16 bytes key - that is 8 characters. The second part is hard-coded.

I tried with simple key like "12345678". It ciphers without any problem. So I expected that the result could only be deciphered with that key. But the fact proved that what I thought was wrong. I can also decipher with a similar key, like "12345679".

Can anyone figure out the reason why this happened?

Thank you so much.

chico0609
Posts: 48
Joined: Mon Sep 14, 2015 5:05 am
Points: 332
Contact:

Re: cipher/ decipher with 3DES alg

Postby chico0609 » Thu Apr 27, 2017 4:17 am

It seems that your problem has something to do with DES weak key. Do you use weak key?

Ruenie
Posts: 12
Joined: Tue Feb 16, 2016 10:02 pm
Points: 135
Contact:

Re: cipher/ decipher with 3DES alg

Postby Ruenie » Thu Apr 27, 2017 6:01 am

I didn't use any weak key. Except 3DES, can I use other algorithms?

chico0609
Posts: 48
Joined: Mon Sep 14, 2015 5:05 am
Points: 332
Contact:

Re: cipher/ decipher with 3DES alg

Postby chico0609 » Fri Apr 28, 2017 4:23 am

Try to use AES instead.

tay00000
Posts: 99
Joined: Tue Sep 27, 2016 10:58 am
Points: 1226
Contact:

Re: cipher/ decipher with 3DES alg

Postby tay00000 » Fri Apr 28, 2017 6:17 am

Provide sample code so that accurate advice on the problem with your 3DES implementation can be given. With only your brief description, nobody is able to properly visualize the problem.


Return to “Algorithm School”

Who is online

Users browsing this forum: No registered users and 1 guest

JavaCard OS : Disclaimer