[comp.sys.handhelds] HP28.Crypt

d89-jon@sm.luth.se (d89-jon) (01/10/90)

Hello,
	   this is the first time I write to  this news group,
and I'm posting two small programs for the HP28C/S calculator.
These programs are  specially made for  paranoid  peoples, who
need to crypt their hp-stuff, for some reson :-).
I  hope,  against  all odds,  that someone will find these two
programs usefull.



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%




CRYPT(1)		USER COMMANDS			CRYPT(1)



NAME
     CRYPT - encode/decode


SYNOPSIS
     CRYPT.1 [3: "string"] [2: real number] [1: 1 or 0]
     CRYPT.2 [2: real number] [1: 1 or 0]

DESCRIPTION
     CRYPT.1  encrypts/decrypts the contents of a string,     by
     taking a string at level 3, a real number,  used as a pass-
     word, at level 2 and 1/0, encrypt/decrypt, at level 1.	
     CRYPT.2 encrypts/decrypts an entire directory using CRYPT.1
     by taking a real number, used as password,  at level 2  and
     1/0 ,encrypt/decrypt, at level 1.

FILES
     CRYPT.1				CRYPT.2
       << -> a b c			  << VARS -> a b c
	  << b RDZ "" 1 a		     << CLLCD 1 c SIZE
       SIZE DUP ->STR				FOR i c i GET
       "Chars to crypt, "		  DUP { CRYPT CRYPT.1
       SWAP + 4 DISP			  CRYPT.2 } SWAP
	   FOR i a i DUP			IF POS 0 ==
       SUB NUM RAND 10 *			THEN
	     IF C 1 ==				  IFERR DUP
	     THEN +			  DUP ->STR "Crypting "
	     ELSE -			  SWAP + 1 DISP RCL
	     END CHR ->STR +		  ->STR a b CRYPT.1
	   NEXT DUP 1 1 SUB		  SWAP STO
       { "<<" "'" "{" "["			  THEN DROP
       "#" "(" } SWAP				  END
	   IF POS 0 <> c 0			ELSE DROP
       == AND					END
	   THEN STR->			      NEXT CLMF
	   END CLMF			     >>
	  >>				  >>
       >>

WARNING
     If the first character in the decrypted  string  is  one of	
     the following six symbols,  << ' { [ # (  , then crypt will
     try convert the string to its proper objekt type.

AUTHOR
     Johan Olsson  <d89-jon@sm.luth.se>

RESTRICTIONS
     Copyright (C) 1989/90 Johan Olsson.    All rights reserved.
     Any  non-frofit  usage  of  this  program  or  any  derived	
     programs  are  permitted.  Any  other  usage  requires   my 	
     permission.

HP28C/S Release 1.0 Last change: 16 December 1989