Vigenère cipher: Difference between revisions
Content deleted Content added
Standard Pascal |
|||
Line 1,701: | Line 1,701: | ||
// convert a string to uppercase |
// convert a string to uppercase |
||
FUNCTION ucase(str: STRING): STRING; |
FUNCTION ucase(str: STRING): STRING; |
||
VAR i: BYTE; |
|||
BEGIN |
BEGIN |
||
ucase := ''; |
ucase := ''; |
||
Line 1,730: | Line 1,730: | ||
vkey := ''; |
vkey := ''; |
||
FOR c := 1 TO Length(pt) DO BEGIN |
FOR c := 1 TO Length(pt) DO BEGIN |
||
n := c mod |
n := c mod Length(k); |
||
IF n>0 THEN vkey += k[n] ELSE vkey += k[Length(k)]; |
IF n>0 THEN vkey += k[n] ELSE vkey += k[Length(k)]; |
||
END; |
END; |