> PWCode/s 1.10  Encrypted logon code  Fully position independent (: 2 mc% &100 <txt=&100:blk=&120:zp=&A8 F P=0 1 P P%=mc% Z [OPT P*3 d .code n\ On entry: x#\ A = num. of strings to encode &\ ie, 1 for *I AM, 2 for *PASS \ XY=>strings to encode, and "\ returned encoded strings \ On exit: (\ A =0, ok with XY=>encrypted string '\ A<>0, error with XY=>error string \ >PHA:STX zp:STY zp+1:LDY #0 :\ Point zp to input string .Lp0 FLDA (zp),Y:STA txt,Y:INY :\ Copy input string to text buffer CMP #13:BNE Lp0 : LDA #0:LDX #6 .Lp1 >STA blk,X:DEX:BPL Lp1 :\ Clear FSOp control block .LDA #7:STA blk+1 :\ Length=7 "CLDA #&42:STA blk+3 :\ FSOp=&42 - Get Encryption Key ,=LDX #blk 255:LDY #blk 256:\ Point to FSOp control block 68LDA #&14:JSR &FFF1 :\ Fetch key to blk!4 @ 5CMP #"{":BCS Up: #&5F :\ Force to upper case .Up G txt+11,X: #&A5 :\ Encrypt with character from  PHA: #&F ACLC:ADC #&41:STA (zp),Y:INY :\ Store low nybble as 'A'-'P' PLA:LSR A:LSR A:LSR A:LSR A BCLC:ADC #&41:STA (zp),Y:INY :\ Store high nybble as 'A'-'P' JINX:CPX #10:BNE Lp6 :\ Loop for ten characters of :  .exit KLDA #13:STA (zp),Y:LDX #20 :\ Put terminating at end of output .Lp7 FSTA txt,X:DEX:BPL Lp7 :\ Overwrite plaintext input string ;LDX zp:LDY zp+1:LDA #0:RTS :\ Return A=0, XY=string  : .end  EQUS "08Oct96-JGH" *: 4] >: H)"*SAVE PWCode ";~mc%;" ";~end;" 0 0" R \: f: p: z:  Demo of use with *I AM  ---------------------- : @ code% &FF,pw% 11 : Space for 10 characters plus "LOAD PWCode "+~code%  "ID: "I$ 5 pw1 : Catch 'Wrong password' error ;"I AM "+I$ : Attempt logon with no password  : $pw1:<>&BB::" at line ";:  $"PW: "P$:P$=P$+" ",10) 5$pw%=P$ : Put string in buffer %P$=10,"*") : Wipe string )X%=pw%:Y%=X%256 : XY=>string $0A%=1:code% : Encrypt one string .."I AM "+I$+" "+$pw% : Do encrpted logon 8 $code%=255,0) : Wipe code B L: V Demo of use with *PASS ` ---------------------- j: tI code% &100,pw% 31 : Encrypted string is 29 chars + ~"LOAD PWCode "+~code% ("Old PW: "O$:O$=O$+" ",10) !"New PW: "N1$:"New PW: "N2$ N1$<>N2$:"Retype PW": N1$=N1$+" ",10) <$pw%=O$+" "+N1$ : Put string in buffer -O$=10,"*"):N1$=O$:N2$=O$ : Wipe strings 0X%=pw%:Y%=X%256 : XY=>string 7A%=2:code% : Encode two strings ?"PASS "+$pw% : Do encrpted password change '$code%=255,0) : Wipe code