A *real* IFF Encoder/Decoder script

Questions about programming languages and debugging
Post Reply
User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

A *real* IFF Encoder/Decoder script

Post by Gogeta70 »

Hey guys. I finished making an IFF encoder/decoder script in PHP that works at a binary level. Feel free to download it and experiment with it on my server.

http://g70net.com/phpanywhere/
The php files are in the .zip. Main.php will show you your encoded and decoded message. Feel free to generate new iff keys by going to the iff_key_generator.php file.


Feel free to comment.
¯\_(ツ)_/¯ It works on my machine...

User avatar
Stavros
ΜΟΛΩΝ ΛΑΒΕ
ΜΟΛΩΝ ΛΑΒΕ
Posts: 1098
Joined: 02 Jan 2006, 17:00
18
Location: Mississippi, U.S.A.

Post by Stavros »

Pardon my ignorance but what is an IFF encoder/decoder? What does it do?

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

I read about it on totse a long time ago. It stands for "If and Only If". Though i have no idea why it's named that way or the meaning behind it, i do know how it works, obviously.

The IFF code is pretty simple to understand. Instead of having a single key to encode or decode your data, you have several. For example:

Key 1: a=r b=m c=i
Key 2: a=s b=q c=h
etc...

Now say you have 100 keys. For each letter (or in this case, byte), you use a different key to encode your letter (or byte). To add additional security, you can specify a sequence of keys. Instead of using key 1, then 2, then 3, you can use key 5, then 72, then 36, etc.

This makes it extremely difficult to decode any data encoded with your keys without having at least most of the keys used to encode the data.
¯\_(ツ)_/¯ It works on my machine...

User avatar
moudy
Technology Enthusiast
Technology Enthusiast
Posts: 688
Joined: 10 Feb 2009, 17:00
15
Location: Beirut, Lebanon

Post by moudy »

Before I read g70's explanation, I thought of IFF as "Identify Friend or Foe" :lol:
Its a technology used by anti air / air planes to identify a friend from a foe.
It turned out some thing completely different...
mahmoud_shihab@hotmail.com

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
18

Post by Gogeta70 »

Pain, you use the iff_key_generator.php file to generate random key files. Then you use seq_gen.php to generate a key sequence to use when encoding and decoding.

If you wish to share data after encoding it with the iff encoder/decoder, you will have to give them the key file and the sequence for them to be able to decode your message.
¯\_(ツ)_/¯ It works on my machine...

Post Reply