Re: binary password in SQL??



timasmith@xxxxxxxxxxx kirjoitti:
Hi,

I used this function to convert the password to a hashe value

public static byte[] getKeyedDigest(byte[] buffer, byte[] key)
throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(buffer);
return md5.digest(key);
}


But the output was completely invalid to use for SQL to save in a field

?ª4úø...¦ÁœIÃÑäjÈ

Without doing a binary save - how can I easily convert the output to
regular ascii?

thanks

Tim


There is no reason why you coulnd't save binary data in SQL database.
Unless of course you are using some DBM or database that does not
support binary data at all. There is a reason for VARBINARY and BLOB
data types. =)

Aki
.



Relevant Pages

  • Re: very confused....hex to decimal
    ... Gerald ... the reason i know it should be 685630.9500000000 is that i ... >>> lance ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Image::Magick and perl script STDOUT problem
    ... script is being executed server side. ... I unsderstand in my example their ... is no reason to be using imagemagick. ... that is supposed to write the binary data to STDOUT, ...
    (comp.lang.perl.misc)
  • Re: [splot] matrix binary or ASCII File ?
    ... I'll peer at the source code to see if ... this was necessary for some reason. ... It's necessary because binary data have no record separator ... The rest of the format flows sort-of naturally from that. ...
    (comp.graphics.apps.gnuplot)
  • Re: Extracting binary file from sql database image field to disk
    ... reason, the zip file is getting corrupted / truncated. ... I have code in ASP ... which extracts the zip file no problem, so i know it is not corrupted in the ... Don't convert the binary data to a string - that's a recipe for a ...
    (microsoft.public.dotnet.general)
  • Re: Problem with inserting bytea into postgresql
    ... >I hav big problem with storing binary data into bytea (postgres) using plain ... There should be no need to use plain text insert. ... data from your SQL database using ResultSet.getBinaryStream, .getBlob, ...
    (comp.lang.java.help)