From: "Adam T. Bowen" <adamb@agitate.org.uk>
To: linux-admin@vger.kernel.org
Subject: Re: MySQL obnoxious question
Date: Tue, 19 Feb 2008 21:01:51 +0000 [thread overview]
Message-ID: <47BB43BF.3000309@agitate.org.uk> (raw)
In-Reply-To: <47BB75CE.7070701@gmail.com>
Hi,
Mário Gamito wrote:
> For obnoxious reasons, I'm running a web site in Windows/ASP.NET/C# that
> once a user registers, it inserts in the MySQL qmail server the
> username, password, etc.
>
> It's in the password that the problem lies.
> I need to hash it just before or after the MySQL INSERT statement.
> For that, I have to run a PHP shell script that follows my signature.
There is an encrypt function in MySQL:
http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html#function_encrypt
but it is only available on systems which have a system crypt call (not
Windows according to the docs). However if your MySQL database is
running on Linux you should be able to just change the insert statement
in the C# code to something like:
insert into user_details values("username", encrypt("password"), ...);
and not bother with the php script. If the database is on Windows, then
there are other encrytion functions available. There is a User Comment
at the bottom of the above web page (search for "Philip Mather") which
discusses using a trigger to achieve something that sounds similar to
what you want.
There are lots of other options, of course, but my first route would
always be to modify existing code. You might want to be careful,
however, that you aren't breaking any license agreement before going
ahead and modifying anything. If the code is unavailable or protected
then you can just put a trigger on the user_details table in the
database and encrypt the password there.
Hope some of that helps.
Cheers
Adam
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2008-02-19 21:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-20 0:35 MySQL obnoxious question Mário Gamito
2008-02-19 17:44 ` Jose Celestino
2008-02-19 22:22 ` Adam T. Bowen
2008-02-20 2:57 ` Atishay
2008-02-19 20:55 ` Jose Celestino
2008-02-19 21:01 ` Adam T. Bowen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47BB43BF.3000309@agitate.org.uk \
--to=adamb@agitate.org.uk \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).