473,520 Members | 2,692 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert a value by encrypting and should be able to get this by decrypting

Hi All,
I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
I want to use a function that can be decrypted . Please help me.

Thanks
Amar

Feb 12 '07 #1
2 1619
Rik
On Mon, 12 Feb 2007 12:14:51 +0100, Amar <gh**********@gmail.comwrote:
Hi All,
I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
I want to use a function that can be decrypted . Please help me.
DES_ENCRYPT() / DES_DECRYPT() in MySQL, or look at mcrypt in PHP:
<http://nl3.php.net/manual/en/ref.mcrypt.php>

--
Rik Wasmus
Feb 12 '07 #2
..oO(Amar)
>I want to insert my password into the mysql database by encrypting it
so that I can also retrieve the password. Before I was using sha1()
for encrypting password,but it is an one way method.
That's how it's supposed to be. Passwords should never be stored in a
decryptable way. If a script can decrypt them, an attacker can do that
as well.

Storing just a (salted) password hash is fine. If a user forgets his
password then he should get a new one.

Micha
Feb 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8979
by: Marshall Dudley | last post by:
I have an application where I need to encrypt a bit of text, and then I need to be able to decrypt it using a customer's key. I want to make sure that the key to decrypt is NOT on the server anywhere, so hackers cannot get the decrypt key, which means I cannot use a symetrical key pair since the encryption key will need to be on the server. ...
3
9821
by: Piotr | last post by:
MS has published on its sites javascript encoder, which enables "encrypting" javascript code. It allows hiding js code from being seen as a text file. There is a decoder for it, available in the net, freeware, srcdec14.exe. I have tested both, encrypting, decrypting, the source and the final files are identical. But what I met on a...
1
3248
by: jimfortune | last post by:
This idea is still in the process of formulation. I'm considering the idea of storing encrypted data in memo fields. Since the data is for internal use only I don't think the legal limits on encryption apply. So memo fields are required because I want to use a couple of 500 or so digit safe primes for the encryption. Note that public key...
13
1974
by: Andy Chau | last post by:
I try to use RSA to implement the following scheme but wasn't sucessful. Sever encrypt a message using a public key, the client decrpyt the message using a private key. I don't want the client to be able to encrypt a message. However, using the Crypto API I need to pass in both the private and public key pairs in order to decrypt the...
0
1489
by: cmrchs | last post by:
Hi, Using the RSA-crypto algorithm in .NET , when actually encrypting/decrypting, all the code samples I ran into always used something like, to encrypt : // create keypair and store in container CspParameters param = new CspParameters(); param.KeyContainerName = "NewKeyContainer"; param.Flags = CspProviderFlags.UseMachineKeyStore;...
3
1678
by: dick | last post by:
Hello, I want to encrypt a file with its filename. I can encrypt the file itself using the frame libraries. How can I now best hide the filename and extension? Within the file, ... ? I must be able to retrieve the filename after decrypting. The original files have random filenames and extensions.
0
1367
by: cmrchs | last post by:
Hi, Using the RSA-crypto algorithm in .NET , when actually encrypting/decrypting, all the code samples I ran into always used something like, to encrypt : ' create keypair and store in container Dim param As New CspParameters param.KeyContainerName = "NewKeyContainer" param.Flags = CspProviderFlags.UseMachineKeyStore Dim rsaObj As New...
3
2871
by: dfa_geko | last post by:
Hi All, I had a question about encrypting and decrypting XML files using asymmetric keys. I copied some sample code from MSDN, here are the samples: http://msdn2.microsoft.com/en-us/library/ms229746.aspx http://msdn2.microsoft.com/en-us/library/ms229919.aspx The samples I used are the ones near the bottom of the page. (With a slight...
2
2263
by: SeeSharp Bint | last post by:
Visual Studio 2005, dotnet, c#. Microsoft SQL Server. Windows XP forms application. Temporarily, for my database application, I have been storing the various elements of database connection items like datasource,password,userid as plain strings in the registry. I'd now like to make these secure against people reading them. I thought of...
0
7299
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7201
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7438
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7602
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7559
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5740
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3282
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
836
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.