>>>>I need to implement in my VFP application being converted to SQL Server backend a Password feature. Currently in the VFP application I have a table MyPasswords.dbf that has (simplified) two column USER_NAME (C(20)) PASS_STR (C(200)). The PASS_STR contains a string like this “YNYNNNY” (just bunch of Y and N) encrypted using a very basic algorithm (which I created so it can be cracked in about 20 seconds <g>). But the application does not need much of security so it works.
>>>>I can basically duplicate the same approach with a SQL Server table but before I do I thought I would ask if SQL Server has a simple (emphasize SIMPLE) way to encrypt a table and un-encrypt it in VFP application?
>>>>
>>>>TIA.
>>>
>>>
>>>Why don't you (md5) hash the password a couple of times and store the hex of the hash in the password field ?
>>
>>Because I don't know how <g>. If you know of a simple article that you can recommend on the topic, please let me know. I will also search messages on UT if someone already posted an example. Thank you.
>
>
>An example of how to Digest a password. It does a some passes depending on the length and the content of the password
>
>
>function Password_Digest(Password, Digest, LeaveBinaryFormat)
>
> local Success
> Success = TRUE
>
> local i, j, obj
>
> do case
> case !md5Bits_Object(@m.obj)
> assert FALSE
> Success = FALSE
>
> case !m.obj.DigestString(m.Password, @m.Digest)
> assert FALSE
> Success = FALSE
>
> otherwise
> for i = 1 to len(m.Password)
> for j = 0 to mod(asc(substr(m.Password, m.i, 1)), 11)
> =m.obj.DigestString(m.Digest+m.Password, @m.Digest)
> endfor
> endfor
>
> endcase
>
> do case
> case !m.Success
>
> case m.LeaveBinaryFormat
>
> otherwise
> Digest = ath(m.Digest) && in hex format
>
> endcase
>
> return m.Success
>
>endfunc
>
First thank you for the sample code. But is brings more questions. What is "md5Bits_Object" and how is it created?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham