Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Password Encryption


When adding a password entry to a database I believe you can encrypt its value using PASSWORD(str) but could someone please confirm what data type I should use for the column in which it is stored?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Password Encryption
What I'd like to do is have an html login page using php to process the request, and then compare the input strings to a username & password stored in a SQL table.

My question is though, what is the best way to store the password in the mySQL table. Is it better to store it as an encrypted value, and can I do this?

Password Encryption
currently using mysql with c# coding.
I need to know how do i encrypt password so that it will not show the password
in plain text when i access the database.

Login / Password Encryption
i am trying to create a very simple login system. all it does it input user data including a password and then when logging it it compares user name and password entered to find the user id (if exists) and then says you are logged in if a result was found. my problem is no results are ever found.

i have found that no matter what i do the password() function never returns the same value when im trying to select a user id with password=password('$inputedpassword') in the query to look up the user id.

so basically when i register the password is turned into a mess with password(), but wheni log in and use the same password() on it, it gives me something different.

BUT if i register under another user name and then use the same password, password() will give me the same mess (i checked this in the databse).

so i dont know why password() wont do the same thing when im using it in the query in login.php so that i can compare the passwords correctly. the only way i've been able to get this to login is to not encrypt anything. i have tried using md5 but that is giving me this same problem too. Code:

What Encryption Is This?
This is a varchar in my db, its my password and I want to change it
but I don't know what kind of encryption it is.

aatiAMXx.sDOA

Encryption
I heard you could encrypt things in MySQL,how do I do it?

SSL Encryption
is it true, that MySQL 4.x can do SSL encrypted connections only with
a server AND a client certificate? I've got a working SSL connection
if I use both, mysqld and mysql with certificate, key and
ca-certificate. How can I use SSL if the mysql client must not have
access to the private key? Any help or links to a good documentation
is welcome.

Encryption
Can anyone advise whether its possible to use the Encode/Decode functions on Windows (Win2K) platform in Mysql & PHP.
A book i'm using says they cannot be used in windows yet i've managed to get my application successfully Encoding a password at the time of using an, 'Insert INTO' qry - its stored ok as a BLOB (field was set-up as a BLOB). Problem is i cannot use the DECODE() to reverese things. When tried i get a 'cannot excecute query' type mssg.
Looked at MD5 and SHA1 but they are one-way funcs only.
I like the look of AES and DES ENCRYPT/DECRYPT but can't get them to work either.

Using AES_ENCRYPT For 256 Bit Encryption
I just started using AES_ENCRYPT to encrypt records in my databases. For the most part, the default 128 bit encryption is fine. But, I would like to use 256 bit for one of my forms. According to the MySQL documentation you can use the function for either 128 or 256 but I don't understand how to get it to do 256.

The documentation says:"Encoding with a 128-bit key length is used, but you can extend it up to 256 bits by modifying the source." - http://dev.mysql.com/doc/refman/4.1/...functions.html

What source do I have to modify to get it to use 256?

Encryption / Authentication
I need to find out if it's possible to do two things with mysql. The =
first is external authentication, preferably with kerberos5, but PAM =
will work as well. Second, encrypting the data stream. Specifically =
with jdbc connections.

Looking For Encryption Tool
I have a prospect that needs to collect sensitive personal data via the web
for mortgage applications. A certificate & SSL seems to protect the data
from the browser to the server, but I need some way to encrypt the data for
storage in mysql and (possibly) into a flat file for retrieval by the
prospect. I have not been able to find a simple solution for this
compatible with BSD and Apache.

Securing My DB With Encryption
I have set up two tables in our DB, and we want to add a third, but this one is credit card info, and need to be secured. What's the best way to do it by encryption?

AES Encryption/Decryption
I have a questiosn regarding AES Encryption/Decryption.

I understand the basics of how it works however i am stumped.

What i am currently trying to do it have a table that contains user information. Now when an authenticated user views this information they are showing all there details in plain text.

Thats fine but what i require is a master key so that if need be the system admin will be able to decrypt any data in the mysql db using there master key.

Is there anyway to do this? either by design or code.

Data Encryption
I am using MySQL on a Windows XP system. I was wondering if there is anyway that I could use OpenSSL (I currently have beta 6 on a dev machine) with MySQL on Windows XP?

Encryption And Decryption
i need a solution to the following requirement
There is a column, for which data should be encrypted in the database, something
like password, where the actual data should not be displayed when i say
select * from tablename, instead, the encrypted text should be displayed, and
that text need to be decrypted again, can anyone please tell me how to do it
front end is java

Need To Modify Input For Encryption
I encrypted a database field using MySQL AES_ENCRYPT() from a command prompt.

I can easily decrypt it because the code specifies a Query but the INSERT is an ADODB insert (see below):

PHP

runQuery($db ->GetInsertSQL($rs, $_POST, true));

I need to AES_ENCRYPT one of the $POST fields before it goes into this but I don't see how? Mcrypt is not installed on server so MySQL functions are what I need to use.


Credit Card Encryption
I am just having my first experience with storing credit card details into a mysql database with php. I am on a ssl server of course and everything works fine but I am interested in any other security recomendations.

Currently CC details are stored directly into the database as they were typed, should I be encrypting the CC details with mcrypt_enrypt() before storing them and then dectypt them when displaying on the "view card details page"?

Securing The AES Encryption Key Using Windows EFS?
I'm planning on using AES encryption methods which require an encryption key. I don't want to store this key as a string literal within my Java front-end web application because of the security risk associated with reverse engineering the Java .class files and obtaining the AES encryption key.

I was thinking of storing the AES encryption key in a file, and then reading this key from the Java application to use within the AES_ENCRYPT function. The file would be encrypted using Windows Encryption File System (EFS) since I'm deploying on a Windows server.

Benefits I see to this approach are that the AES encryption key is stored separate from the .java application, and the file containing the key is encrypted to everyone except the Windows account that encrypted the file.

The drawbacks are the application needs to have rights to accesss the file, the protection of the key now hinges on the Windows Account used to encrypt the file (if that is compromised then the key could be discovered); also, I need to further research where the private key used to encrypt the file is stored on Windows and how secure that is.

MySQL Logging And Encryption
If logging is turned on, is there a way to disable it for a given query?

IE. If I query --> select AES_ENCRYPT("This is very important data",
"lessthansecretkey");

Then my key and the value I'm trying to encrypt is visible in the log
files.

Encryption Of User / Pass In Odbc.ini / Alternatives
Does anyone know of a more secure way than storing the username and password
to the database connection within the odbc.ini ? We are using PHP on one
server connecting to a MySQL 4.0 database ?

Random Password Vs. User Created Password For Site Login
Are there any security issues or other concerns that make one preferable? The client is pushing for user created passwords.

I'm mapping out the basic functionality and front-end for a MySQL/PHP back-end that will be completed by a third party. I'm a novice to MySQL but familiar with PHP and their interaction. Mainly looking for anything to support one method over the other.

Mysql Password() & Unix Crypt Password...
I am creating a user administration system where system administrator
can activate services for a user, like webspace, a mail account or a
subdomain.

I now want to create a function that creates mysql databases and grant
the right privileges to a user. But the problem is that mysql wants to
have the plaintext password for the user in the "grant ... identified by
'pwd'" field, or in a manual query to update the password in the
mysql.user table with PASSWORD('pwd').

I have another database which holds the passwords for the users, these
password are stored the moment a user signs up and are used to activate
services, for example ssh access to the machine. The stored passwords
are encrypted using crypt(). So for adding a ssh service to a user, I
simply do echo "$user:$pwdhash" | chpasswd -e.

I have chosen crypt because some programs (like proftpd) don't take md5
sums.

The problems is that I don't have the plaintext password. So I cannot
add a mysql db.

So I need to create a user in mysql with a crypt password.
I tried to just "grant all privileges ... identified by 'nothing'"
and then afterwards update the mysql.user table and putt the crypt
password in there but it doesn't work like that.

Does anyone have any idea on how I could fix this, how can I create a
user in mysql without having his plaintext password and only having a
crypt hash of it.

I thought about not only storing a crypt hash, but also an md5 hash and
a mysql PASSWORD() hash.. but I think that's an ugly solution.

I Can Connect With Db Password Or Blank Password
I have a password setup for root (% and localhost) in Mysql 5.0.26, I can connect ok no problem. I can also connect with blank password! I know it is checking the password cuz it fails if it's wrong.

I'm sure I have only one account as well (tried to delete, recreate, etc... no change)
select * from user where user='root';
| localhost | root | *F3AD8B3C44772C17F66767F29D948D9C255BD824 | Y ...
| % | root | *F3AD8B3C44772C17F66767F29D948D9C255BD824 | Y ...

Is there an option to accept blank password!? I have this problem only for root user; Other accounts are fine.

I Changed Root Password But I Can Not Login With Changed Password
I changed the password of root with
update user set password=password('newpassword')

Then I exited. But when I want to login again , it cannot authenticate the root
I should tell you that a hacker had changed my root password before. Because it was not encrypted before.

Using Password NO
i keep getting this error i know iam useing the right password and i have set it to use old passwords? any idea's?

Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in D:userdb.php on line 4

Warning: mysql_select_db(): Access denied for user 'ODBC'@'localhost' (using password: NO) in D:userdb.php on line 5

Warning: mysql_select_db(): A link to the server could not be established in D:userdb.php on line 5

Getting A Password
I am trying to figure out how to get a password for a sql on my forums... My host provides where it installs the forums and just generates the sql stuff... Is there a way for me to figure out how to get the password?

Password()
I have a little question. I am making a "forgot password" script, and have all the passwords encrypted with the password() function. But obviously when i send the email i need this uncrypted. I need help with how this can be achieved, if possible. (couldnt find it the the documentation.

Password?
I have installed MySql 4.1 on Windows XP (not as a service, manual start), but when I try to access the Command Line Client it asks me for a password and I have no idea what it is.

Password
After the installation in windows xp, I write in DOS mysqladmin -u root -p password newpwd; but the answer is:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (Using password: NO)'

How can I do?

If I use the istance configuration wizard, I have error when, after the new password, I start execute: Could not start the service MySQL. Error:0

Password
I have trixbox 1.2.3 running and in freePBX it told me I need to change the password in mysql. I went into mysqladmin and privileges. I updated the passwords for a2billinguser and root.

Now I am denied from access to mysql and all services that use mysql don't work. How do I restore the default that trixbox used. I have a very large major system here and cannot just blow it away.

Password
I have screwed up my password somehow. I have just started using MySQL and downloaded the Administrator. Also trying to use Dreamweaver and following their instructions tried to use the Administrator to set up a user with no name. NOw when I try to set mySQL it asks for my password which apparently is invalid (computer beeps).

Now I cannot use mySQL. How do I recover from this?

Password
Anyways I have created a simple table like this ....

create table myusers(membernum mediumint(10) default '0' not null auto_increment, fname varchar(10) not null, lname varchar(10) not null, phone char(10) not null, access varchar(10) not null, Primary Key(membernum) Unique(phone));

the table is created perfectly in mysql, the problem comes when to use php. First I have a simple insert statement when a user signs up it looks like this:

$sql = "insert into myusers values(NULL, '$fname','$lname','$phone', Password('$pword')"l

That updates the database just perfectly as well it even encrypts the password like it is supposed to.. the problem comes in when I try to run this query to see if the user exists:

$newsql = "select phone, access from myusers where phone='$phone' && access = Password('$pword')";

When I run that query it returns a 0 result set. If I run it from the command line and do the same thing only using the actual values instead of the variables it still returns a 0 result set. However if I put in the actual encrypted password it shows correctly.

Why does my query not work when I use the Password('$pword') in my query?

Having A Password
I want to be able to hold a password in my table in some kind of secure way.
I have tried to insert a user record into a table using md5() for the
password which is inserted in the database like this...


insert into users values('', 'sim0rsy', md5('banana'), 'Matt', 'Munn', 'Student');

this is the query that I think should work but it doesnt, what am i missing?

select * from users where username='sim0rsy' and password='banana';

Password()
we just moved our websites over to another datacenter and in the process noticing that we are having troubles logging into some of our sites.

Just as a quick test I manually updated a test user's password to password=password('hello') but the funny thing is when I try to login with hello, no record found. I echo the query and paste it into mysql and it shows empty results.

SO I then queried for it to show me the record for this user and it shows the encrypted password to start with an * and then all characters are CAPS. No matter what I update the password to, this is the case. All alpha chars are caps and the pass starts off with an *.

Has anyone run into this before? All of this worked before and our data looks ok in our tables but if you update the pass, it screws it up bad.

Using Password: YES
I installed on my laptop MySql Server in Windows, and I've a problem login in with a simple user.

With user root, it works ok, but when I try to coonnect with other user, I always obtaint the error message "using passowrd: YES" (MySQL error 1045). If I try to connect via command line with "mysql -u user" without indicating a password, it works ok, but if I try with "mysql -u user -p", when I enter the password, I have the error.

If I tried to connect from MySqlAdministrator or QueryBrowser I have the same issue if I write the password, and a good connect without password.

Password
I'm using mysql 4.1.7 on a Mac with os 10.3, everything works unless I set a password for the root user using phpMyAdmin 2.6.0.

If I log out then try to log back into phpMyAdmin I get the 1251 error, I then clear the password using Navicat (which connects to mysql just fine with the new password)
Then I'm back to normal with phpMyAdmin, any ideas why I can't set a password and still access mysql ?

How Do You Set A Password?
I entered in "set password for 'wikiuser'@'localhost'=password("password")" but it says it couldn't find any matching rows. But there is a row with that host and user. Also, there IS a password in the row, but when I try to install mediawiki, it says check username and password.

Password
This is PHP/MySQL code. Is the syntax correct? I seem to be getting the die message no matter what password I type into my form.

$sql = "update members set password = "password("$new")" where id = $ID3 and password = "password("$current")"";

$rs = @mysql_query($sql, $conn) or die("The current password you supplied was not valid. <a href="$link">Try again.</a>");

Password
How can I easily obtain the password to a mySQL database? Its mine, its on my server, and I have mySQL installed.

Password
I've downloaded and install this mysql-essential-4.1.10-win32.msi. I run the MySQL Command Line Client and now it ask me to "Enter Password:" where can i get the password?

Password Set Up
I am trying to install MySQL Essential 4.1. on Windows ME and it will not let me set up a password. I have installed it on Windows 2000 before and it took me through several dialog boxes setting up a password. On Windows ME it already seems to have set up a password and kicks me out when I try running MySQL. Do I need to be connected to the Internet when Installing? Is there a difference installing on Windows ME.

Password
I can't seem to set the password for root. What is easiest way to do such?

Password
Is there anyway of knowing the root password of a MySQL database?? I know we can change the root password to a new one, but I want the root password of an existing database. Is this possible?

Password
Whenever I type in mysql password in the command prompt, where it says: Enter password, the system just beeps and the mysql window disappears.

No Password
When I'm trying to access a database, MySql answer that
my access is denied for user root@localhost . For database ...
When I'm going in the users section of PhpMyAdmin, It said:
No user (s) found
What can I do, is there a manual way of adding user/password ???

Have To Set Password In Phpmyadmin
I am using php4 and mysql and running them in IIS. I installed all in C:.
Then I put phpmyadmin folder into the wwwroot folder. When I login http://www.mysite/phpmyadmin then it display the login page of username & password. If I keep blank those 2 fields it just direct enter to the "welcome page" of the phpmyadmin & doesn't show any option to change password or other option of the mysql. So the problem is any one can login directly to the database of the mysite.

Please tell me what should I do???

Is it for mysql setup (its userid & password), or php setup or itegration os there version or something else?

Root Password
So the root password was set to something that is currently unknown, how can I go about resetting it?

I can see in the mysql database, ie the following path

C:/program files/mysql/data/mysql

in the file user.MYD that the user root appears to have password root but it does not seem to work. Any ideas? I don't have the disk to reinstall at the moment. Running version 4.0.21-nt

Remove A Password
I want to remove the password used to acces mysql.

Any idea how to do this?

I tried with mysqladmin -p, but this doesn't work.

Password() Function
I've created a simple table called users. This table contains four columns. First_Name, Last_Name, User_Name, Password. I've used the password() function when inserting a user. I have read the documentation on using other types of encryption, but it's killing me that I can't get this to work. Robert has a User_Name of "Bob" and a password of password('tomato').

===============================
HOW I ADDED BOB

insert into users values("Robert","Evans","bob",password('tomato'));

1 row added yada yada

HOW I QUERY BOB

select * from users where User_Name="bob" and password=password('tomato');

Empty Set

===============================

That exact same query is in a tutorial for a simple PHP login form, but an empty set is returned even in the command prompt using MySQL by itself, therefore the script cannot move on.

Password Hashing.
My Distribution is Fedora Core 3.
I have MySQL installed on my Linux webserver and I can't get the new Passwords to work
The packages I installed for MySQL are:
MySQL-server 4.1.12-1,
MySQL-client 4.1.12-1,
MySQL-shared-compat 4.1.11-0,
MySQL-Max 4.1.12-1
MySQL-devel 4.1.12-1

I have runned the script MYSQL_FIX_PRIVILEGES_TABLES.


Copyright © 2005-08 www.BigResource.com, All rights reserved