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!

Encrypt database primary keys

843811Sep 29 2005 — edited Oct 1 2005
Hi all,

Currently i am coding a kind of private message system for my webapplication.
If the primary keys of the messages are send to the client in plain text, a user could in-/decrease the ids and could perhaps get access to messages of other users.

I thougth to encrypt the database ids with 3DES before i create the HTML code.
So if a user manipulates the id no object in database will be found.

1. I don't understand, that the decrypt method does not throw an exception when the encrypted string is wrong.
The result contains only some ? characters.
A program can not react on wrong encryption text.

2. The database id start from number 1.
What's the minimum plaintext for 3DES encryption.
Do i have to fill up with zeros to a special length?

thanx
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 29 2005
Added on Sep 29 2005
13 comments
328 views