1

How do I go about encrypting "username" so that it is not saved in plain text format in database. I was looking for a module that does this, but couldn't find one.

Would adding logic (hook_user_presave() and hook_user_load()) as described in How can you encrypt the username and email address in the database, to protect against emails being stolen from a compromised database (D7) be sufficient? The accepted answer says:

This is just my point of view, but if you want do it what you can use this module http://drupal.org/project/aes and with some user hooks, such as hook_user_presave() and hook_user_load().

1
  • 3
    I was poking around in user.module yesterday, and saw a bunch of queries that relied on username (eg, user_is_blocked). This may be baked in pretty deep.
    – mpdonadio
    Commented Mar 28, 2014 at 23:02

1 Answer 1

0

I think it may be easier to store an arbitrary string or number (maybe the UID) as the username, and then store the actual (encrypted) username in a custom field.

This would mean writing a custom login script that uses your custom table, however it means you won't have to start changing stuff in the users module.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.