Perl and encryption


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl and encryption
# 1  
Old 09-29-2010
Perl and encryption

Basically, I'm wondering if there's an easy way to encrypt the password to a username and store it in MySQL. But being able to authenticate to it.
# 2  
Old 09-29-2010
Comparing passwords is easy, just compare the hashes. That way you need never keep actual passwords in your database. MySQL even comes with a nice password hash function.
Code:
INSERT INTO mylogintable(user, password)VALUES('name', PASSWORD('text'));
# Will return exactly one result when password is valid
SELECT user FROM mylogintable WHERE user='name' AND password=PASSWORD('text')

# 3  
Old 09-29-2010
use a mysql encryption function on your insert. you can also use these functions to validate the password.

MySQL :: MySQL 5.1 Reference Manual :: 11.13 Encryption and Compression Functions
# 4  
Old 09-29-2010
Thanks for your help. I've always been sort of a noob when trying to work directly with the DBI function. Any recommendations on what to read for documentation? A quick and reliable brush-up and reference, if you will.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Encryption in Linux?

Hi, we have a brand new Centos 6.8 build, and after some discussion it seems that there is some interest in securing the entire system using whole disk encryption. What is/are the best option/s, and is this something that can be done after Centos is installed (like for example PGP WDE in Windows... (2 Replies)
Discussion started by: xdawg
2 Replies

2. Shell Programming and Scripting

Data Encryption

Using awk or sed command how can i encrypt the characters for a particular column.For every character it should replace the third charter of alphabets.Example replace "A" with "C" and "B" with "D"..like this it should replace for all characters in particular column. Using below command i am able... (3 Replies)
Discussion started by: katakamvivek
3 Replies

3. Cybersecurity

File encryption tools with MAC address as an encryption key

Hi all, I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS. For example: when A wants to send file to B A will encrypt the file with B's computer MAC/IP address as an encryption key This file can only be decrypted... (2 Replies)
Discussion started by: sergionicosta
2 Replies

4. UNIX for Dummies Questions & Answers

Password encryption

if I change my password on two different servers, using the same string but the encrypted password in /etc/passwd look different. If I copy an entry from one /etc/password to the other server. I can still log in to both servers using the same password. Only now both /etc/passwd entries are... (2 Replies)
Discussion started by: C0ppert0p
2 Replies

5. Shell Programming and Scripting

AIDE Encryption

Hey All, I need to implement AIDE on my client machines. The builds on these machine are different, so each workstation will have its own specific db generated through running AIDE initially. It is not good practice to just leave the db on the machine, since an "attacker" would be able to view... (0 Replies)
Discussion started by: mibaile5
0 Replies

6. Linux

Question about Encryption...

hey guys, how're you all doing?? guys i wanna ask a question about something we can call it encryption!! i want to encrypt a file by converting it to (hex or octal) then convert another file witch will be the code to hex or octal also, then add them together and convert the result again to... (2 Replies)
Discussion started by: iam_ako
2 Replies

7. UNIX for Dummies Questions & Answers

File encryption/Key encryption ????

My dilemma, I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
Discussion started by: hugow
1 Replies

8. Programming

Encryption Tutorials

Hi , I would like to know how to write encrytion functions in c++ in linux environment.so would like u get some tutorials on the topic. Can anyone help (1 Reply)
Discussion started by: wojtyla
1 Replies

9. Shell Programming and Scripting

encryption is possible??

NEED expertise help for this topic!!! Question 1: Is encryption possible for the shell scriping programing? shadow the scriping file, do think is impossible... Question2: built a simple program with the simplicity function that allow user change settings by enter corret name and... (3 Replies)
Discussion started by: trynew
3 Replies
Login or Register to Ask a Question