• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

BadPaddingException

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to store a user password encrypted in the database.
I've created a class based on an example using JCE.. Here are some code extracts :

It works fine in my junit test which encrypts a given value and decrypts it to it's original.

The problem arrives when I save the encrypted password in the database (oracle). When I try to retrieve the encrypted String and try to decrypt it I receive the following Exception :



The column in the database is of type varchar2 and has a length of 255.
I think it has something to do with the storage in the database since I can do the encryption/decryption in a unit test.

Any help is highly appreciated...

Thanks.

Kristof
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are the database and the database connection running in UTF-8 mode as well?
reply
    Bookmark Topic Watch Topic
  • New Topic