NODE e92193bdRC4 for HP48
cpunk@remail.ecafe.org (ECafe Anonymous Remailer)Mon, 22 Jan 96 18:22:03 PST
-----BEGIN PGP SIGNED MESSAGE-----
Here is the RC4 cipher for the HP-48 calculator. It
complements the DES implementation by William E. Sommerfeld.
RC4 has a higher throughput than DES, but its key setup is
slower. The key may be up to 256 characters (2048 bits) --
the maximum supported by the RC4 algorithm.
Here are sample timings for a HP-48GX. The SX will be
correspondingly slower.
Key Setup (200 bits) 25.18 sec
RC4 throughput 5.06 cps
String to Array 61.83 cps
Array to String 56.12 cps
The HP-48 comes with a 2400 baud IR link and a
1200/2400/9600 baud RS232 port. The 48S, 48SX and 48G have
32Kb of RAM, almost none of which is used by the operating
system. The 48GX has 128Kb of RAM. With an entry price of
~100$ US, I feel that the HP-48 series would be a good choice
for a smart token. Possible uses are as digital cash wallets
and authentication tokens, not the mention simple encrypted
dumb terminals.
Installation:
If you have a serial cable, download the code below to
your HP and call it 'RC4'. This will create a directory
called 'RC4' with four programs in it. If you don't have a
cable you can type the whole thing in; it's not too large.
Store it as 'RC4' and again it will create a directory. Remember
not to type the "%%HP: T(3)A(D)F(.);" -- it's only needed for
a serial download.
Instructions:
These instructions assume that you are familiar with
stream-ciphers in general. If you are not, you might want to
get _Applied Cryptography_ by Bruce Schneier from your library
or book store.
Bit streams are represented as one dimensional arrays of
real numbers between 0 and 255. Yes, that's right, this
cipher uses floating-point! In User-RPL it's the fastest way.
To convert between strings and arrays use the commands S2A and
A2S.
S2A "String" -> [Array]
A2S [Array] -> "String"
To setup a key, use the SK command. It takes a
bitstream representing the keytext and returns the key
context. They keytext can be up to 256 bytes long.
Additional bytes will not be used. The key context is another
bitstream with 256 values in it. Because of time/memory
tradeoffs, a key context takes 2082 bytes of RAM to store. If
memory is tight, use A2S to compress the key context to a
string.
SK [Key text] -> [Key context]
To encrypt something use the RC4 command. The first
argument is the key context, the second is the plaintext or
ciphertext, both in bitstream form. It returns the updated
key context and the ciphertext or plaintext.
RC4 [Key context], [Plaintext] ->
[New key context], [Ciphertext]
or
RC4 [Key context], [Ciphertext] ->
[New key context], [Plaintext]
Enjoy
The Cunning Artificers
- -- CUT HERE --
%%HP: T(3)A(D)F(.);
DIR
SK
\<< DTAG OBJ\-> OBJ\-> DROP 0 255
FOR N N NEXT 259 258
PICK + 0 259 4 FOR N OVER
PICK N PICK + + 256 MOD DUP 255 - NEG N
4 - DUP2 IF \=/
THEN DUP2
IF >
THEN SWAP
END
DUP2 6 + ROLL SWAP 6 +
ROLL SWAP 4 ROLL 5 + ROLLD SWAP 3 +
ROLLD
ELSE
DROP2
END SWAP 1 - DUP
IF 260 <
THEN
DROP 258 PICK 259 +
END SWAP -1
STEP DROP2 0
0 258 \->ARRY OVER 2
+ ROLLD DROPN "Key"
\->TAG
\>>
RC4
\<< DTAG DUP SIZE OBJ\-> DROP 3 PICK
258 GET 4 PICK 257 GET 1 + 1 4 ROLL
FOR N 256 MOD 1 + DUP 5 PICK SWAP
GET 3 ROLL + 256 MOD 1 + DUP 5 ROLL
SWAP 4 PICK CSWP DUP DUP 5 PICK GET
OVER 5 PICK GET + 256 MOD 1 + GET 5
ROLL DUP N GET R\->B 3 ROLL R\->B XOR B\->R
N SWAP PUT 4 ROLL 4 ROLL 1 - SWAP
NEXT 4 ROLL 257 3 ROLL 1 - PUT
258 3 ROLL PUT "Updated key" \->TAG
SWAP "Result" \->TAG
\>>
S2A
\<< DUP SIZE
\<< \-> LEN
\<< 1 LEN
START DUP NUM SWAP TAIL
NEXT DROP LEN
\>>
\>> EVAL 1
\->LIST \->ARRY
\>>
A2S
\<< DTAG OBJ\-> OBJ\-> DROP "" SWAP 1
SWAP START SWAP CHR SWAP + NEXT
\>>
END
- -- CUT HERE --
- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2
mQCNAzEAEf4AAAEEAMONoLHj5CwKvaM6ch9GOcUjgoVS5sjXa4TzD2ohhtHFYR9l
QzNj0vNASBQKE/Mk9Flqg+dtitS7S7B0qZQ+mQmMT73yniun596jt1NCJ5sLBKrM
jDvYK3wGbycVX43RBiR3iwJZGq5blfWqNRE7kFdTxgu+bCdtLOFNVew9oBf9AAUR
tBZUaGUgQ3VubmluZyBBcnRpZmljZXJz
=pf3Y
- -----END PGP PUBLIC KEY BLOCK-----
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQCVAwUBMQRCWuFNVew9oBf9AQEPJgP/QzwxGIWU0sf+a8Vzj2tXtMqRhRQjG4Qp
Pcrwr76WhM/2KnHGNAdC3lKwyEK17cu32zbmPePhOvtdUNyV3L1KZlBioURK5Kxu
ZspnOLCmlKo8lbOa5mJl2bmV55W49B96ua+yxst1XaOzhfYDN/KjZsztGRnEbQx9
VovMpLXooLo=
=4pzv
-----END PGP SIGNATURE-----
NODE d575c2bbRC4 for HP48
m5@dev.tivoli.com (Mike McNally)Tue, 23 Jan 1996 22:06:30 +0800
ECafe Anonymous Remailer writes:
> Here is the RC4 cipher for the HP-48 calculator...
You know, it'd be interesting to start loudly reporting such obvious
ITAR violations. Not, of course, because I feel myself threatened as
a result of this attack on national security, but because it might
make life more difficult for Them. When They decide to hassle some
well-chosen target (a la PZ) over such stuff, it'd make for
interesting filler if reporters could add to stories paragraphs like
"...dozens of ITAR violations have been reported in recent months, but
until now officials have taken no action, leading many to believe that
Bob Cypherdude is being singled out for harrassment."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Nobody's going to listen to you if you just | Mike McNally (m5@tivoli.com) |
| stand there and flap your arms like a fish. | Tivoli Systems, Austin TX |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NODE 35cfaa9aReporting ITAR Violations
futplex@pseudonym.com (Futplex)Wed, 24 Jan 1996 15:16:59 +0800
-----BEGIN PGP SIGNED MESSAGE-----
ECafe Anonymous Remailer writes:
# Here is the RC4 cipher for the HP-48 calculator...
Mike McNally writes:
> You know, it'd be interesting to start loudly reporting such obvious
> ITAR violations. Not, of course, because I feel myself threatened as
> a result of this attack on national security, but because it might
> make life more difficult for Them.
[...]
I would feel a bit more comfortable if violations by non-anonymous entities
were well publicized. Otherwise, we may force the TLAs to cash in the
"weapons export" card against the anonymizers, and hasten a crackdown on
them. (In this particular instance, the remailer resides outside the ITAR
zone, but that detail could be conveniently ignored in calling for a ban on
U.S. remailers.)
I'm still hoping for a test of the PA anonymity prohibition....
Futplex <futplex@pseudonym.com>, still catching up on last week's mail
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
iQEVAwUBMQXagSnaAKQPVHDZAQHZTwf/WrHgbZjgiJIXxW886mKO/E/eoSLh0eSE
IBnfnDABTmAUcbvUEo/UMn7n7Gsq03mJgyo9z1+6SUGxhqt45MV41d7rZQVhkBWs
+woh7YqGIiqGF9elvaVUlp7xsqyKLdXVQYqkahe0M4Ouw7S033HYIC+6lW6kTBeC
C0vOnwyoB82WJ1x2SRH8iz7/lCWJkQkDSiRJ3yaAB4UtXvsikug3ddvOGz2tbL19
sxlxoJslD5MlqcH8ubKqDvHR++N432cOKMOHR82GjAm8b2f4/0lmaDWAxDaaWNFb
jk0EH5Ax8gECoBWl6dw3Sw3asWNbM0M9UIthEmOTjiJoOb9cRxjoNw==
=O3fc
-----END PGP SIGNATURE-----