06-16-2003, 12:35 AM
For clarification...
This has to be reversable? Or could I write an hmac md5 algorithm and be done with it?
Easiest way would be to take the password and the key and simply rotate the letters up by the key. This is often used in cryptography for good reversable encryption, and has been used to transmit confidential messages.
Basically...
Or...
Result:
OYGCMXKSPJAM
It can easily be decrypted by subtracting with the key.
-[Unknown]
This has to be reversable? Or could I write an hmac md5 algorithm and be done with it?
Easiest way would be to take the password and the key and simply rotate the letters up by the key. This is often used in cryptography for good reversable encryption, and has been used to transmit confidential messages.
Basically...
Code:
M Y N A M E I S W H A T <-- message
C A T C A T C A T C A T
-----------------------
O Y G C M X K S P J A M
Or...
Code:
key$ = "cat"
text$ = "mynameiswhat"
IF LEN(key$) < LEN(text$) THEN
longkey$ = ""
FOR i% = 0 TO LEN(text$) \ LEN(key$)
longkey$ = longkey$ + key$
NEXT i%
ELSE
longkey$ = key$
END IF
result$ = ""
FOR i% = 1 TO LEN(text$)
x% = ASC(UCASE$(MID$(text$, i%, 1))) + ASC(UCASE$(MID$(longkey$, i%, 1))) - 65
IF x% > ASC("Z") THEN x% = x% - 26
result$ = result$ + CHR$(x%)
NEXT i%
PRINT result$
Result:
OYGCMXKSPJAM
It can easily be decrypted by subtracting with the key.
-[Unknown]