No problem. One time pad is known since 1915~1920: is very easy, fast and NSA proof.
Here is the heart of the program. There are two input files, the readable one and the key, and an output file: the coded one.
OPEN "I", #1, FILEIN$:LFILEIN# = LOF(1)
OPEN "I", #2, FILECHIAVE$:LFILECHIAVE# = LOF(2)
IF LFILEIN# < LFILECHIAVE# THEN CONTA# = LFILEIN# ELSE END
OPEN "O", #3, FILEOUT$
FOR NCARATTERE# = 1 TO CONTA#
CARATTEREIN$ = INPUT$(1, #1)
CARATTERECHIAVE$ = INPUT$(1, #2)
NUMEROIN% = ASC(CARATTEREIN$)
NUMEROCIFRA% = ASC(CARATTERECHIAVE$)
NUMEROCIFRATO% = NUMEROIN% XOR NUMEROCIFRA%
CARATTERECIFRATO$ = CHR$(NUMEROCIFRATO%)
PRINT #3, CARATTERECIFRATO$;
NEXT
CLOSE
Decoding uses the same program, with the the coded file as input.
Coding/decodig statement is the one with XOR inside.
My problem is the coded file that may include EVERY byte from 0 to 255, I can "clean" the key but NOT the the coded file.
Tha attachment is a BINARY file with a short example, open with an Hex editor, NOT with a text editor.