; ENCRYPT
;
; Program for Proteus
;
; (C) 1998-2004 Simone Zanella Productions
;
; Encode the file with the specified keys; if you need to specify more
; than one key, enclose them between double quotes.
IF OR(ISEMPTY(ARGV(5)), ISEMPTY(ARGV(6)))
CONSOLELN "Syntax: " ARGV(1) " " ARGV(2) \
" .. destination filename \"key [key..]\""
CONSOLELN ""
CONSOLELN "Write to destination the contents of \"filename\" " \
"encrypted with the specified keys."
ABORT 0
FI
H = FOPEN(ARGV(5), 1)
IF EQ(H, -1)
CONSOLELN "File \"" ARGV(5) "\" not found."
ABORT 1
FI
V = VECSPLIT(STRIPQUOTES(ARGV(6)), " ")
WHILE NOT(FEOF(H))
S = FREAD(H, 4096)
IF STRLEN(S)
FOR X = 1 TO VECLEN(V)
CRYPT(@S, VECGET(V, X))
NEXT
PRINT S
FI
LOOP
FCLOSE(H)
ABORT 0