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 734369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:21:56+00:00 2026-05-14T07:21:56+00:00

I have created a registration page using CI that works fine. However, I encoded

  • 0

I have created a registration page using CI that works fine. However, I encoded the password using sha1 (see code snippet below), and now that I plan to create a login page, I need to check whether the password the user enters in the login page is the same as that password encoded using sha1 stored in the database. However, I just realized that sha1 is non-decodable.

So how do I use CI’s encryption class to both encrypt and then decrypt this password for login purposes? Any assistance will be appreciated. Thanks in advance.

function register_user($username, $password, $name, $email, $activation_code){

 $sha1_password = sha1($password);  
 $query_str = "INSERT INTO table_name (username, password, name, email, activation_code) >VALUES (?,?,?,?,?)";    


$this->db-query($query_str, array($username, $sha1_password, $name, $email, $activation_code));

}

  • 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-05-14T07:21:56+00:00Added an answer on May 14, 2026 at 7:21 am

    There is no need to decrypt the password, only comparing for equality. That is all that is necessary for user identification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using VB6, I have created an Outlook plugin, that has a property page. The
I have made customized user registration page. and i have made that on theme
I have created Facebook registration page, What i want to do is user can
I am using the built-in asp.net membership framework. I created a registration page and
I've created a registration system using django-registration. I have extended the RegistrationFormTermsOfService as shown
I have a registration page that receives tokens ad parse them and login the
I have created a multi-page registration form for a website. Due to the page
I have currently created a facebook like page that pulls notifications from different tables,
I have created a custom dialog for Visual Studio Setup Project using the steps
I have created a PHP-script to update a web server that is live inside

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.