Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^4: encrypt passwords

by bitingduck (Chaplain)
on Apr 17, 2015 at 16:25 UTC ( #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.


    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1123787]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2018-06-20 15:34 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.