<i><font color="#663300"> OTHERWISE llRetVal = This.EncryptionRoutine(tcString, "ENCRYPT", /at/ tcEncryptedString) </font></i>
Greetings Graeme,
The encryption used here is interesting, but hardly difficult to break .D.OT I think you should have the code if only to feel complete. I am pretty sure that the intent was to allow each devleoper to substitute another encryption method here, as desired.
May I suggest looking for CIPHER50.ZIP in a public library? Here is the code from .encryptionroutine:
************************************************************ * Method: String.EncryptionRoutine() - DATA.VCX * *) Description: *) This method encrypts and decrypts character strings * * Parameters: * <expC1> - the string to encrypt or decrypt * <expC2> - the desired action ["ENCRYPT"|"DECRYPT"] * *@ Inputs: None * Outputs: None *$ Usage: *$ <objectname>.EncryptionRoutine( <expC1> , <expC2> ) * *â0 Example: *â0 THIS.EncryptionRoutine("Catmandu","ENCRYPT") - encrypts *â0 THIS.EncryptionRoutine("AMD9mlkd","DECRYPT") - decrypts * * Returns: CHARACTER - encrypted/decrypted character string. * * Invariants * 1. Pre-Condition: * a. The desired action is a valid request * b. The first parameter is a string * * 2. Post-Condition * a. If ENCRYPTING the string returned is encrypted * b. If DECRYPTING the string returned is readable * * *? Notes: None * Local Routines: None *-- Process: *-- 1. Determine the length of the string *-- 2. FOR the length of the passed string *-- 3. DO CASE *-- 4. CASE Encrypting *-- 5. Encrypt the digit equal to the count of the FOR loop *-- 6. CASE Decrypting *-- 7. Decrypt the digit equal to the count of the FOR loop *-- 8. ENDCASE *-- ENDFOR * * Change Log: * CREATED Tuesday, 03/19/96 20:53:39 - CTB: ************************************************************ LPARAMETERS pc_string, pc_func, pc_encryptedstring
LOCAL lc_estr, ln_long, ln_pos
*°°°°°°°°°°°°°°°°°°°° MEMORY VARIABLE DEFINITIONS °°°°°°°°°°°°°°°°°°°°°° *° lc_estr - Encrypted string ° *° ln_long - Length of character string passed ° *° ln_pos - Character position ° *°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
lc_estr = ""
*-------------------------------------------------- *-- Determine the length of the character string *-------------------------------------------------- ln_long = LEN(pc_string)
*-------------------------------------- *-- For the length of the entire string *-------------------------------------- FOR ln_pos = 1 TO ln_long DO CASE CASE pc_func = 'ENCRYPT' *--------------------- *-- Encrypt the string *--------------------- lc_estr = lc_estr + CHR(ASC(SUBSTR(pc_string,ln_pos,1)) + ; ln_pos + ln_long)
CASE pc_func = 'DECRYPT' *--------------------- *-- Decrypt the string *--------------------- lc_estr = lc_estr + CHR(ASC(SUBSTR(pc_string,ln_pos,1)) - ; ln_pos-ln_long) ENDCASE ENDFOR (ln_pos)
pc_encryptedstring = lc_estr
RETURN IIF(EMPTY(lc_estr),.F.,.T.)
*-------------------------------- * EOM: String::EncryptionRoutine() *--------------------------------
James Sayer ©2001 James Sayer |