-5

Please, any suggestion how to create encrypt method like md5

$pass = "abc";
$password = xyz($pass);

Above method i want to create it myself like md5 method

Please any help me, how can i create it.

MD. ABDUL Halim
  • 712
  • 3
  • 11
  • 32
  • 3
    `md5` is not encryption, and you shouldn't roll your own cryptographic functions anyways because you will almost certainly fail to secure them. Also, `md5` as a method of hashing passwords is **obselete** and **insecure**. Switch to [bcrypt](http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php) or PBKDF2. – Waleed Khan Feb 11 '13 at 12:28
  • What is the reason you wish to create your own hash, rather than using one of the ones we already have? – TS00 Feb 11 '13 at 12:28
  • 7
    If you have to ask, you shouldn't even think about creating your own encryption method. – Wooble Feb 11 '13 at 12:28
  • Basically i mean that i will create a method like md5() which will encrypt any thing . For example it can be method which xyz(); it will work like md5(). – MD. ABDUL Halim Feb 11 '13 at 12:30
  • Brother, You are bad guy which has give negative point because you should encourage a newer person but you discourage so i am very unhappy which has give negative point. – MD. ABDUL Halim Feb 11 '13 at 12:43
  • Can i know why shouldn't i create own encryption method. Wooble. – MD. ABDUL Halim Feb 11 '13 at 12:50
  • Personally I think, It is not a bad idea to learn of hash/encryption algorithms. Yes it can be very bad idea if you are using your custom algorithm into production, But for learning purpose, It should be supported. – kuldeep.kamboj Feb 11 '13 at 13:37

1 Answers1

0

Take a look at this website to get an idea:

http://lifehacker.com/5856506/how-to-create-a-personal-information-encryption-scheme-to-easily-hide-your-data-in-plain-sight

After that, when you know the "technique" of encrypting data try to implement it to the language of your choice. In this case if it's PHP you will have to crate a function which will handle the encryption for you.

Basically the system is unencrypted string comes in, encrypted string gets returned from the function. The difficulty and method of encryptment is completely up to you - if you want to have something that just moves character a number of places up or down, or if you want something more complex.

Dropout
  • 13,653
  • 10
  • 56
  • 109