RE: VFP9 SP1 encoding little endian UTF 16, SHA1, base64

Author: Tracy Pearson

Posted: 2009-05-08 at 15:23:24

STRCONV() can get you base64 but not UTF16, though UTF8 is there.

There has been threads previously on Crypto, either someone else will give

their two cents, or you can search the threads.

That looks like it might be .NET, it's possible some of this information can

be gotten through Craig Boyd's encryption FLL. I've not used it either.

HTH,

Tracy

-----Original Message-----

From: KAM.covad

Sent: Friday, May 08, 2009 2:54 PM

I need to encode a password:

1. convert to upper case (yes, I know how to do this)

2. Unicode it in little endian UTF16

3. SHA1 it

4. base64 encode it

Here is an example I was given, but I have never used those methods and I do

not believe they are in VFP

The encoding process for password is: first convert to uppercase, then

Unicode it in littleendian

UTF16,

then SHA1 it,

then base64 encode it.

UnicodeEncoding encoding = new UnicodeEncoding();

hashBytes = encoding.GetBytes(password.ToUpper().Trim());

SHA1 sha1 = new SHA1CryptoServiceProvider();

byte[] cryptPassword = sha1.ComputeHash(hashBytes);

String pwd= Convert.ToBase64String(cryptPassword);

Anyone know where to start looking? I searched google but could not find

anything that could easily be converted to vfp code.

©2009 Tracy Pearson