I want to Encrypt a passwords to this Syntax:
CWsodEV5xi9F0D8Vxw1fSZ==
I do not know what kind of this encryption for syntax
please I want Encrypt & Decrypt Function!
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure about what you try to accomplish, but in general: Please develop applications in such a way that user passwords are not retrievable in plaintext in any way (e.g. no decode function).
Since many users use the same password on multiple services, I consider it bad practice if it is technically possible to view the password of a user: If you service (or your hosting company) somehow fails to protect, say, the database with passwords + mailadresses, these users are out in the open: these credentials potentially open the doors to many abuses on different apps / websites. In short: I wouldn’t want to even appear to be responsible for that.
As some answers above point out, it is very preferable to use a secure hashing algorithm on your password system /database. Hash functions are irrevirsible, which means: if you do
and then, if you want to authenticate that user, you just do it again:
provide the salt (also in the database, could be the username and/or a random value) and calculate the hash again:
Then, you simply compare the user_key to the valid_key:
This was just a short example, of course there are many different implementations and hashing algorithms, these are just the basics.
An additional advantage of hashing is this: the hashes (which you store in your app, e.g. database) are always the same length (sha1 is always a 160 bit hex value).
So you can give the paranoid users the ability to make a password of insane lengths if they like, with all kinsd of strange characters in it (like backticks or spaces), while it doesnt cost you any extra storage space.
Hope i gave you the information you needed. Of course, it may be the case that you already know about hashing etc. and are just looking for a specific hash function which may have produced the hash you provided in the question. In that case, just ignore this post 😉
[EDIT]
Nowadays there are much better alternatives, such as PBKDF2, Bcrypt (see this question) or even Scrypt. Please do consider one of these schemes, as they are much more secure, especially for relatively short passwords.