S- - 3


init InitialTr(), 64

RESTORE FinalTrl

DIM FinalTr(1 TO 64) AS shared INTEGER

init FinalTr(), 64

RESTORE swappyl

DIM swappy(1 TO 64) AS shared INTEGER

init swappy(), 64

RESTORE KeyTr1l

DIM KeyTr1(1 TO 56) AS shared INTEGER

init KeyTr1(), 56

RESTORE KeyTr2l

DIM KeyTr2(1 TO 48) AS shared INTEGER

init KeyTr2(), 48

RESTORE etrl

DIM etr(1 TO 48) AS shared INTEGER

init etr(), 48

RESTORE ptrl

DIM ptr(1 TO 32) AS shared INTEGER

init ptr(), 32

sboxinit s()

RESTORE rotsl

DIM rots(1 TO 16) AS shared INTEGER

init rots(), 16

DIM XR(1 TO 56) AS shared INTEGER

DIM EF(1 TO 64) AS shared INTEGER

DIM ikeyf(1 TO 64) AS shared INTEGER

DIM yf(1 TO 64) AS shared INTEGER

18.3

DIM ades(1 TO 64) AS shared INTEGER

DIM bdes(1 TO 64) AS shared INTEGER

DIM xdes(1 TO 64) AS shared INTEGER

DIM XT(1 TO 64) AS shared INTEGER

DIM P2(1 TO 64) AS shared INTEGER

'

main:

CLS

parm$ = ltrim$(rtrim$(COMMAND$))+" "

IF LEN(parm$) > 1 THEN

Plainf$ = LTRIM$(RTRIM$(LEFT$(parm$, INSTR(parm$, " "))))

PRINT " : "; Plainf$

ELSE

INPUT " : ", plainf$

END IF

if len(plainf$)=0 then

print : print ": !"

system

end if

OPEN plainf$ FOR RANDOM AS 1

lof1& = LOF(1)

IF lof1& = 0 THEN

CLOSE #1

KILL plainf$

PRINT : PRINT " !";

SYSTEM

ELSE

IF lof1& > 9999999 THEN PRINT : PRINT " !": SYSTEM

CLOSE #1

OPEN plainf$ for binary access read as #1

END IF

cipherf$ = ""

sp0% = 0: sp% = 0

DO

sp0% = sp%

sp% = INSTR(sp% + 1, plainf$, "\")

18.3

LOOP WHILE sp% > 0

bplainf$ = RIGHT$(plainf$, LEN(plainf$) - (sp0%))

PRINT " : "; bplainf$