views:

1035

answers:

6

Are DES Encryption called "One Way Encryption" or "two way Encryption" ? Are there a PHP class or method decrypt the DES Encryption ? thanks

+2  A: 

DES can be reversed, so it's a two-way encryption (if you meant that).

DES is a pretty well known encryption standard so it should be available in PHP too.

Tigraine
A: 

I am not familiar with the "one way encryption" or "two way encryption" terms. There is a term "one time password" (totally irrelevant for DES), and there are "symmetric" and "assymetric" encryption algorithms, meaning whether the same key is used for encryption and decryption (symmetric) or a set of two different keys is used one for encryption and another for decryption (assymetric). DES is a symmetric algorithm. As for PHP, crypt() since to be doing the job:

http://us2.php.net/crypt

crypt is a one-way hashing function
Paul Dixon
+3  A: 

The php crypt function is a one-way hashing function, if you want to be able to decrypt, take a look at the mcrypt extension which supports a range of algorithms

Paul Dixon
+2  A: 

It should be noted that there are (and have always been) questions surrounding the DES algorithm. It's been widely in use for a long time, but since it was originally specified with only a 56 bit key, it's questionable whether it's secure enough for any important uses at this point. Triple DES is generally better, but there are some known theoretical attacks. If you have a choice of cipher, you might want to look at AES instead.

Michael Kohne
+1  A: 

One-way encryption is a secure form of hashing: the plaintext is changed into an apparently random sequence of data, often of fixed length, in such a way that the original plaintext (theoretically) cannot be retrieved without a brute-force effort.

Two-way encryption, or reversible encryption is what we normally mean by the term encryption: the plaintext is transformed into apparently random data, but in a way that relies on a "key" that allows the original plaintext to be retrieved.

DES is a form of reversible encryption that is relatively weak by today's standards, as it relies on a 56-bit key (14 hex characters). It has been superseded by 3DES, or triple-DES, which is essentially the same algorithm with a longer key.

You don't mention your application, but if you need only to compare the data and not retrieve it, hashing is considered more secure. For example, you can store hashed passwords; then, when a user authenticates, perform the same hash on the entered text and compare it with the stored hashed value. If they match, the correct password was entered.

A significant advantage to hashing is that you don't need to store a decryption key.

Adam Liss
A: 

I Think you probably mean a one-way function [1]. In cryptography one distinguishes between symmetric and asymmetric cryptography. Symmetric cryptography uses the same key to encrypt and decrypt (DES is symmetric). Asymmetric Cryptography is used for key exchange and a public key is used to encrypt the message, while the private key is used to decrypt it. An example of Asymmetric Cryptography is AES [2]. Asymmetric cryptography uses one way functions.

[1] http://en.wikipedia.org/wiki/One-way_function [2] http://en.wikipedia.org/wiki/AES

Nils
You are mistaken about AES. It is a symmetrical key based algorithm. The rest of your answer is imprecise as well.
Tall Jeff
Sorry I did too much things at the same time. I meant of course RSA and not AES.
Nils