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

  • SEARCH
  • Home
  • 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 5989239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:04:24+00:00 2026-05-22T23:04:24+00:00

At last i try Encryption and Compression Functions in mysql for secure password and

  • 0

At last i try Encryption and Compression Functions in mysql for secure password and username.

DES_ENCRYPT function is perfectly work for encrypt. I give the code which i use to encrypt and save in database.

MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = "insert into user (User_Id, Password, Branch, Upto_Date) values (DES_ENCRYPT('" + textBox1.Text + "'),DES_ENCRYPT('" + textBox2.Text + "'),'" + comboBox1.SelectedItem.ToString() + "','" + textBox4.Text + "') ";
connection.Open();
command.ExecuteNonQuery();
MessageBox.Show("Record Succesfully Added", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
connection.Close();

But i have trouble to retrieve data in DES_DECRYPT function.

I try "select DES_DECRYPT(User_Id),DES_DECRYPT(Password),Branch,Upto_Date from user"
code to retrieve but no use,. What i do for get the data from mysql datatable?.

My sql datable

the last record is inserted using DES_ENCRYPT() function.

  • 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-22T23:04:25+00:00Added an answer on May 22, 2026 at 11:04 pm

    DES_DECRYPT is the way to decrypt DES_ENCRYPTed data.

    Lets stick to the SQL part of it. Easy example:

    /* generating test table */
    CREATE TABLE `test` (
      `testField` varchar(512) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1
    
    /* adding some test data to it */
    INSERT INTO test () VALUES (DES_ENCRYPT("Hello")), (DES_ENCRYPT("World"));
    

    Now to find out how it does look encrypted…

    SELECT testField FROM test;
    
    +-------------+
    | testField   |
    +-------------+
    | €p!˜*D°k    |
    | €ü«ü€D»Ûë   |
    +-------------+
    

    …and decrypt it!

    SELECT DES_DECRYPT(testField) FROM test;
    
    +-------------+
    | testField   |
    +-------------+
    | Hello       |
    | World       |
    +-------------+
    

    Basically, if you decrypt it this way as you’ve described it, the database should return the plain text.

    My advice:

    1. Try to start with figuring this out on the SQL side first (phpmyadmin, SQLyog, there are plenty of tools to directly work on the MySQL database).
    2. If this is working, move to your .NET program to finish this.

    Another note, if you use this kind of password protection, a clear password is used between your application and the database server. Even if this connection might be SSL-“protected”, I’d advise to not do it this way. It usually is safer to use Hash-Algorithms (like SHA512) for this purpose and just store the Hashes in your database to avoid clear passwords at all.

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

Sidebar

Related Questions

I'm using the last() function to try to get the last entry in my
I try to get the last modification date of a file: NSFileManager *fm =
Ok, I'm going to try to make this more clear because my last question
Last Friday where I work, an oracle client was upgarded and our IIS server
Last night I added a parameter to a stored procedure in a mySQL database.
I try to change from Activity to Activity from andengine and last loaded very
When I try to get a month before last from today, I run date
I start with SQLAlchemy and i try to get my last insert (a Tweet)
See second to last input please. Note: I was using http://try.mongodb.org/ > person =
When I try the last example from perlfaq5: How-do-I-count-the-number-of-lines-in-a-file? I get an error-message. What

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.