Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am implementing the IDEA) So there is a question: how is the input text interpreted?(as far as I am concerned the IDEA uses XOR,multiplication mod(2^16+1) and and addition mod(2^16) operations. So how should I interpret English letters into bits???). Any help is appreciated!
Posted
Comments
[no name] 10-Oct-15 7:04am    
Only for information, that not everybody has to search:
https://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm[^]

"English letters ": Until now I did not know that the letters are in English. I must, willy-nilly to learn.

Here an effort how letters are represented in bits:http://www.ascii-code.com/[^]
BillWoodruff 10-Oct-15 7:40am    
Keep in mind that "English letters" (glyphs) may be encoded in a variety of ways, like ASCII, Unicode, etc.

If the text is written with ASCII encoding, you get 8bits per character. That is, you take 8 characters for one block of 64bits; you may need to feel up remaining space by e.g. \0.
For other encodings, the width is typically 16bits, then take 4 characters per 64bit block.
 
Share this answer
 
Comments
[no name] 10-Oct-15 10:27am    
Pure ASCII is 7 bits
In computers, a bit is the base of any data. For practical reasons, a group of 8 bits is used, the name is byte.
A byte is the minimum unit of data available. Absolutely every thing is made of bytes.
All you need is to cast anything to a byte array and feed the encryption routine with blocs of 8 bytes, no matter what they are. There is no interpreting to do, English letters or not.
C#
Encrypted_data = IDEA_Encrypt(Original_Data, Key);
// Original_Data is a bloc of 8 bytes containing anything
// Key is the encrypting key.
// Encrypted_data is the 8 bytes encrypted result
Decrypted_data = IDEA_Decrypt(Encrypted_Data, Key);
// Decrypted_data is equal to Original_Data, no matter what.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900