Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8046857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:55:28+00:00 2026-06-05T05:55:28+00:00

i have made a login and register page. but my passwords aren’t encrypted yet.

  • 0

i have made a login and register page. but my passwords aren’t encrypted yet. people told me that’s a bad idea and that i should encrypt them. so i have been searching around on how to encrypt and decrypt my passwords. i have found an example on how to encrypt my passwords but i do not know how to decrypt it again for my login page. here is my encrypt code:

$key = "some random security key";
$input = $password;

$td = mcrypt_module_open('tripledes', '', 'ecb', '');
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
mcrypt_generic_init($td, $key, $iv);
$password = mcrypt_generic($td, $input);
mcrypt_generic_deinit($td);
mcrypt_module_close($td);

so my question is: can someone tell me what codes i need to decrypt the strings i get from the code above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:55:30+00:00Added an answer on June 5, 2026 at 5:55 am

    I see you’re a bit confused with how this works. Read this article and you’ll come to know all about encryption, decryption, hashing and their use in a login system.
    http://net.tutsplus.com/tutorials/php/understanding-hash-functions-and-keeping-passwords-safe/

    So basically, you hash a password into a hexadecimal string on registration and store it in the database. Each time the user wants to login you take his current i/p password, hash that and store it in a variable like $temp.

    Now, you retrieve the original password’s hash from the server and simple compare the two hashes.

    …if they’re same then access granted!

    The many reasons you don’t want to keep encrypting and decrypting a password are as follows:

    • When being passed to the server the user entered password is in plain
      text or can be easily stolen/sniffed.
    • The server has to compute the process of decrypting the password stored in the database each time it is required, as opposed to
      hashing where we just do a logical compare.
    • If the file containing the encyption algorithm is compromised w/ the database, all passwords are lost in plain text. As users may use
      same passwords on multiple sites, the threat is extended.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a web application that uses master page for Login & Logout
I made a login/register page. It works fine on chrome and firefox, but doesnt
I've created a login and register page where people can login or register if
I have a small block that contains something like this: Login | Register When
I have been trying to make a user login page that, when the user
Its a simple login form that I have made using Classic ASP, where the
I have a UserController that have methods like Register, Login, Logout, etc. On my
I have made small web-app in jsp with a start page with login and
Ok so I have made a login action but I'm a bit confused on
I have made an iPhone App which has a loginwithFacebook button , the login

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.