You could try an LFSR, it only needs as much extra ram as your key is long plus one bit :P It';s not cryptographically secure at alll though, but it's very suitable for Digital Signatures. In fact, CRC is an LFSR with an extra input block and no streaming output. The algorithm for a 15-bit two-tap CRC of "x^15+x^1+1" is: New = (Old<<1) + (Old<0> XOR Old<14>) Here's a list with valid tap bits. It's hard to come by on the internet, I had to brute-force them all! (on pentium assembly, still took me hours!) 2 bits: 1, 0 3 bits: 2, 0 4 bits: 3, 0 5 bits: 4, 1 6 bits: 5, 0 7 bits: 6, 0 9 bits: 8, 3 10 bits: 9, 2 11 bits: 10, 1 15 bits: 14, 0 17 bits: 16, 2 18 bits: 17, 6 20 bits: 19, 2 21 bits: 20, 1 22 bits: 21, 0 23 bits: 22, 4 35 bits: 24, 2 38 bits: 27, 2 29 bits: 28, 1 31 bits: 30, 2 (note that some bit lengths have no valid two-tap LFSR's) Mark -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist