View previous topic :: View next topic |
Author |
Message |
Irfan Ahmed Just Arrived
Joined: 12 Jun 2007 Posts: 0
|
Posted: 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.
|
|
Back to top |
|
|
Elderan Just Arrived
Joined: 08 Jun 2007 Posts: 0
|
Posted: 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
Last edited by Elderan on Tue Jun 12, 2007 1:36 pm; edited 1 time in total |
|
Back to top |
|
|
Advocate Just Arrived
Joined: 31 Aug 2006 Posts: 0 Location: Amsterdam, NL
|
Posted: 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
|
|
Back to top |
|
|
Elderan Just Arrived
Joined: 08 Jun 2007 Posts: 0
|
Posted: 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'.
|
|
Back to top |
|
|
|