
-----------------------------------
md
Wed Oct 18, 2006 9:47 pm

Encryption Done Proper
-----------------------------------
Because I am paranoid (and thus spend a lot of time thinking about encryption), and to keep people from posting their own (not at all secure) encryption schemes I present the code for TEA (Tiny Encryption Algorythm). The code presented here suffers from a minor key collision; however it's best known attack is still > brute-force. It's a 64bit block cypher, with a 128bit key. 


 void encrypt(unsigned long* v, unsigned long* k) {
     unsigned long v0=v

That encrypts a block, so clearly you need to implement more then that. But at least no one needs to go trying to implement AES or Blowfish.

TEA has a few weaknesses. Most notably, it suffers from equivalent keys "” each key is equivalent to three others, and this means that the effective key size is only 126 bits (Kelsey et. al., 1996, and Vikram Andem, 2003). This weakness led to a method for hacking Microsoft's Xbox game console, where the cipher was used as a hash function. TEA is also susceptible to a related-key attack which requires 223 chosen plaintexts under a related-key pair, with 232 time complexity (Kelsey et. al., 1997).

Because of these weaknesses, a number of revisions of TEA have been designed, including XTEA

[edit 2] Yes, it's C code... but really given how simple it is I should hope that anyone could implement it in their language of choice, even *shudders* turing.

-----------------------------------
apomb
Thu Oct 19, 2006 6:26 pm


-----------------------------------
wow, md, thats pretty cool, ive been starting to read "Digital Fortress" - Dan Brown  again, and was actually looking into encryption algorithms in languages i know.  thanks for the example! :)

Note:  Turing will NOT be used by this guy

-----------------------------------
bugzpodder
Sat Oct 21, 2006 9:15 pm


-----------------------------------
:P weren't you the same person who came up with that encryption method that encrypts different strings onto the same encoding?

-----------------------------------
md
Sat Oct 21, 2006 9:28 pm


-----------------------------------
:P weren't you the same person who came up with that encryption method that encrypts different strings onto the same encoding?

No no, it was much more complex then that; it was a ceasar cypher, that changed depending on the number of characters seen before hte current one. It was secure... but only in that it mangled the data much to well. It wasn't possible to decrypt things. :P

I know I do not (yet) have the expertise to creat a secure cypher, hence why I have been reading up on other peoples ;)

-----------------------------------
bugzpodder
Sun Oct 22, 2006 7:35 pm


-----------------------------------
there's a crytography class offered, may want to look into that.  its under C&O
