Franco later sent his code, which converts the byte array into a String of hex characters, two characters per byte, thus 40 characters for the 20-byte array generated by MessageDigest.digest(). Brett On Thu, 10 Feb 2005 17:08:04 +0000, Niall.Smart@xxxxxxxxxxxxxxx <Niall.Smart@xxxxxxxxxxxxxxx> wrote: > Is SecurityHandler.encryptToString() and IBM specific extension? I > couldn't find mention of it anywhere... > On Wed, 09 Feb 2005 20:05:26 +0100, Franco Biaggi <fbiaggi@xxxxxxxxxx> > wrote: > > this is possible, due to data conversions... > > try to store the passwords in plain text like: > > > > String encrypted_pwd = SecurityHandler.encryptToString( enteredPassword > ); > > The only problem with this method is that the Strings generated are 40 > characters long (I just ran a test case), and the password field in > the database is only 25 characters long. I'm trying to change the > method of encryption without changing the database. We are installed > in hundreds of locations and updating the AS400 library is only done > when absolutely necessary. > > Is there a way to pack these bytes closer and still use Strings? I > realize that packing them as single characters is what is giving me > the headache in the first place. > > If I have to, I'll change the field length, but this would be a last > resort, and would delay the change for at least 6 months. -- Brett Slocum <slocum@xxxxxxxxxxxxxx>
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.