Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Password encryption
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00646532
Message ID:
00646541
Views:
14
Hi Larry
Make 2 methods, or functions
Encript and Decript:
*( This is The encript Function or Method
*{ Encodes the text password that is passed to this method.
*{ A random character is created and plugged in front of the
*{ encoded password.
LPARAMETERS lPassword

LOCAL lRandChr, lEncodePass, lPassword
lRandChar = CHR( ASC( RIGHT( SYS( 3), 1)) + 101)  && Random character
lEncodePass = ""

*{ Create characters from the password
FOR nCnt = 1 TO LEN( ALLTRIM( lPassword))
   lEncodePass = lEncodePass + ;
      CHR( ASC( SUBSTR( lPassword, nCnt, 1)) + 101)
ENDFOR

*{ Add the random character in front of the encoded password
lEncodePass = lRandChar + lEncodePass
RETURN lEncodePass
And this Is the Decription
*{ Decodes the encrypted password that is passed to this method.
*{ A random character is removed from the front of the
*{ encoded password before decoding.
LPARAMETERS lCrypted

LOCAL lCrypted, lDecryptedpass

lCrypted = SUBS( lCrypted, 2)                     && Remove random character
lDecryptedpass = ""

*{ Decode the encrypted password 
FOR nCnt = 1 TO LEN( ALLTRIM( lCrypted))
   lDecryptedpass = lDecryptedpass + CHR( ASC( SUBS( lCrypted, nCnt, 1)) ;
      - 100)
ENDFOR

RETURN lDecryptedpass
Add this in a prg or a Method in your form. Call it and see what happens.
HTH
What is Wisdom?
Wisdom - The ability to respond to any situation according to God's Plan.
Therefore:
USE Wisdom IN Everything ORDER priority AS Knowledge
SELECT Knowledge
BROWSE FOR Understanding WHERE Wisdom=Guide

LeRoy Jackson
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform