Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: encrypt passwords

by bitingduck (Chaplain)
on Apr 17, 2015 at 16:25 UTC ( [id://1123787]=note: print w/replies, xml ) Need Help??


in reply to Re^3: encrypt passwords
in thread encrypt passwords

An alternative that's maybe a little simpler depending on the use case is to store them in a local file that only the process that needs them has read permissions for. It's probably still worth putting some encryption on it to prevent accidental viewing in case permissions get messed up, but it will be useless against an actual attacker, who would probably get access to the perl code, too.

Replies are listed 'Best First'.
Re^5: encrypt passwords
by CountZero (Bishop) on Apr 17, 2015 at 19:12 UTC
    store them in a local file that only the process that needs them has read permissions for
    That is not a bad idea but it may get messy if you have to update the file: either you give more users access to the file or you must switch to become the user that has sole access or --horror-- you become root to access the file, a sure way to mess things up badly.

    Most databases allow fine-grained access levels to the data: reading, writing, deleting, updating, ... all or some can be given or not to specific users.

    For man years I run a claims database that once was acccessible through a web-page. The webserver only had a read access to the main data-tables, but could add/update/delete records in tables that stored comments. I never had any corruption of the main data tables, but regularly had to "clean" the tables holding the comments.

    As the OP already has a database-server running, it will be no big effort to add a small table with the password data.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123787]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found