Hi Everybody,

I would like to know the best way for storing passwords treated by the MD5
function.
I noted that MD5 returns strings without text encoding:

    MD5( aString ).Encoding = Nil

REALSQLDatabase usually store UTF-8 strings. So I should convert the MD5
function's result into UTF-8 encoding. But before that I have to define an
encoding. Is it ISOLatin1 ?

If I store the MD5 version of the password directly into the database
(without encoding treatment), I could meet some problem. For example, if the
password is:

    aaaa

The MD5 version is (displayed by MsgBox):

    t½s7EBŒ²?ğf=‰Â

This cause a database error:

    error code: 1
    error message: Incomplete SQL statement

It's because of the quotes generated by the MD5 function.

What is the best strategy ?

I have also an underlying question.
What is the best strategy to store data including quote symbols ?
Have I to use the ReplaceAll method to twin every quotes ?
For example:

    aStringToStore = aStringToStore.ReplaceAll( """", """""" )
    aStringToStore = aStringToStore.ReplaceAll( "'", "''" )
    aStringToStore = aStringToStore.ReplaceAll( "Œ", "ŒŒ" )

And so on.

Thank you for your ideas.


Have a good day,


Nils

----

Nils Frisch

http://www.nils-frisch.com/

Toulouse,
France.


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to