--- title: "Crypto (Syntax)" id: 76382 type: "computer_media" slug: "crypto-syntax" url: "http://localhost/computer_media/crypto-syntax/" markdown_url: "http://localhost/computer_media/crypto-syntax.md" published_at: "2026-11-11T08:02:46+00:00" modified_at: "2026-11-11T08:02:46+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/crypto-syntax-1.png" excerpt: "Encode and decode secret messages with a keyword, in only 2K." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Imre Auersbacher" slug: "imre-auersbacher" taxonomy: "indiv" url: "http://localhost/indiv/imre-auersbacher/" genre: - name: "Entertainment" slug: "entertainment" taxonomy: "genre" url: "http://localhost/type/entertainment/" media_type: "Program" programmers: - name: "Imre Auersbacher" slug: "imre-auersbacher" taxonomy: "indiv" url: "http://localhost/indiv/imre-auersbacher/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Crypto%20%281984%29%28Auersbacher%2C%20Imre%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1984" images: - url: "http://localhost/wp-content/uploads/2026/11/crypto-syntax-1.png" - url: "http://localhost/wp-content/uploads/2026/11/crypto-syntax-2.png" article_media: - id: 19917 title: "Crypto" type: "article" url: "http://localhost/article/crypto/" media_type_tags: "Entertainment" license: false --- # Crypto (Syntax) A cipher program. Answer C to encode or D to decode, type the keyword (the screen shows CENSORED instead), and enter the message. The program shifts each character by the matching letter of the keyword, repeating the keyword as needed, and prints the result. Decoding with the same keyword gives back the original message; the wrong keyword gives nonsense. Keyword and message can be any length and may use letters, digits, spaces and the symbols .,:;$()+-=?*, but not graphics characters. The keyword is cleared at the end of each run. The article suggests using it as a subroutine to protect data files. Published in Syntax September 1984 ([Crypto](https://timexsinclair.com/article/crypto/)). ## Source Code ``` 5 FAST 10 PRINT "CIPHER/DECIPHER? C/D"; 15 INPUT Q$ 16 PRINT Q$ 18 PRINT 20 PRINT "KEYWORD:"; 30 INPUT Y$ 40 PRINT "CENSORED" 42 PRINT 45 DIM Z(LEN Y$) 50 FOR Z=1 TO LEN Y$ 60 LET Z(Z)=CODE Y$(Z)-13 70 IF Z(Z)<0 THEN LET Z(Z)=51 110 NEXT Z 200 PRINT "ENTER MESSAGE:" 210 INPUT M$ 220 PRINT M$ 230 PRINT 260 IF Q$(1)="D" THEN GOTO 400 300 PRINT "CIPHER -->" 305 LET Y=1 310 FOR Z=1 TO LEN M$ 315 IF Y>LEN Y$ THEN LET Y=1 320 LET T=CODE M$(Z) 325 LET X=Z(Y)+T+9 328 IF T=0 THEN LET X=X+64 330 LET X=X-51*INT (X/51)+13 332 IF X=63 THEN LET X=-1 334 PRINT CHR$ (X+1); 335 LET Y=Y+1 340 NEXT Z 350 GOTO 500 400 PRINT "DECODED -->" 410 LET Y=1 420 FOR Z=1 TO LEN M$ 430 IF Y>LEN Y$ THEN LET Y=1 435 LET T=CODE M$(Z) 440 LET X=T-Z(Y)-24 445 IF T=0 THEN LET X=X+64 450 IF X>=13 THEN GOTO 460 454 LET X=X+51 456 GOTO 450 460 IF X=63 THEN LET X=-1 465 PRINT CHR$ (X+1); 470 LET Y=Y+1 480 NEXT Z 500 CLEAR ```