one function required which can encrypt and decrypt the text

Networking/Security Forums -> Cryptographic Theory and Cryptanalysis - Internal and Transmission Security

Author: Irfan Ahmed PostPosted: Tue Jun 12, 2007 10:35 am    Post subject: one function required which can encrypt and decrypt the text
    ----
I need to know about any cryptographic algorithm in which we dont need to use separate functions to encrypt and decrypt the text using symmetric key.

Though We can also make a simple function by combinning encryption and decrytpion functions using any switch statement or if-else.But it is not required.

I need to know about any function in which if we pass simple text with key, it encrypts it or vice versa.

Author: Elderan PostPosted: Tue Jun 12, 2007 12:00 pm    Post subject:
    ----
Hi,
Enigma was such an algorithm, but not realy secure.

Using a block cipher would be a problem, and I dont know any block cipher where the encryption also the decryption methode is.

But every (or most?) stream cipher has this property. E.g. you can use RC4, where the encryption routine also the decryption routine is, but RC4 is not recommended for new applications (it's realy hard to use the algorithm so that it is secure).

An other possibility is using a block cipher (e.g. AES) in OFB or CTR mode, which would be my choice.


Stream cipher has the following characterization:
Plaintext ^ Keystream = Ciphertext (Encryption)
but also:
Plaintext = Ciphertext ^ Keystream (Decryption)

^ means XOR, and the keystream has to be the same for encryption/decryption.

Edit:
Replaced chiffre by cipher Wink


Last edited by Elderan on Tue Jun 12, 2007 1:36 pm; edited 1 time in total

Author: AdvocateLocation: Amsterdam, NL PostPosted: Tue Jun 12, 2007 1:00 pm    Post subject:
    ----
I'm not really following the line of questionning, but couldnt you use almost any implementation of a Feistel Cipher?


This is a block cipher where the encryption and decryption routine is the same in most cases.

Just as a side note to Elderan, could we use 'cipher' as opposed to 'chiffre' you're mixing language mid sentence and it grates a little Smile

Author: Elderan PostPosted: Tue Jun 12, 2007 1:49 pm    Post subject:
    ----
Hi,
Quote:
This is a block cipher where the encryption and decryption routine is the same in most cases.

Normaly, for encryption you have to use the encryption routine reverse, means e.g. for decryption you add first the last round key and so on.

But I think, Irfan Ahmed, wanted the following:
P: Plaintext
C: Cipher
E(x): Encryption

C = E(P);
P = E(C);
P = E(E(P));

This is, afaik, only with a stream cipher possible (or a block cipher in stream mode), resp. I don't know a block cipher where the encryption routine also the decryption routine is (although the routines are very simular).

PS: Sry, for chiffre and cipher, I'm not a native speaker, and so it's realy hard to change (or avoid) some habits, because the German word for 'block cipher' is 'Blockchiffre'.



Networking/Security Forums -> Cryptographic Theory and Cryptanalysis - Internal and Transmission Security


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group