473,675 Members | 3,658 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 1632
Rik
On Mon, 12 Feb 2007 12:14:51 +0100, Amar <gh**********@g mail.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
8985
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. What I need is more like a public key cypher. But I want the customer to be able to create his...
3
9832
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 certain site is a js file, encoded I think in another way, because I cannot decrypt it using the...
1
3256
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 encryption has been around for quite a while so some organizations may have a pretty large prime...
13
1996
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 message. When the client has both private and public key, it can just use the public
0
1515
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; RSACryptoServiceProvider rsaObj = new RSACryptoServiceProvider(param);
3
1703
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
1373
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 RSACryptoServiceProvider(param)
3
2878
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 modification of moving edElement.KeyInfo.AddClause(new KeyInfoEncryptedKey
2
2273
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 encrypting/decrypting each string when i write to the registry but I wouldnt know where to find a...
0
8515
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8966
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8675
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8717
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6275
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4259
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2120
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.