Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 07-06-2004, 11:09 AM   #1 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
Working with an encrypted password in a class.

I have a User class. For simplicity let's say this class has 2 members: username, password.

The encrypted password is stored in the database.

Would you store the plain text password as the value of the password string? or would you store the encrypted value as it is in the database?

password = "mypass"
vs.
password = "23lkfsdf9823lksdfi23kjsdf"

( that is supposed to look encrypted )
__________________
Mike
sde is offline   Reply With Quote
Old 07-06-2004, 11:52 AM   #2 (permalink)
joe_bruin
LOAD "*",8,1
 
Join Date: Feb 2003
Location: la.ca.us
Posts: 254
joe_bruin is on a distinguished road
why would you ever want to store the plain-text password?
joe_bruin is offline   Reply With Quote
Old 07-06-2004, 11:53 AM   #3 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,140
Belisarius is on a distinguished road
I trend towards using the encrypted version, as it prevents some sloppt coder sometime in the future from doing a System.out.println(password), thereby revealing passwords for the whole world.
__________________
GitS
Belisarius is offline   Reply With Quote
Old 07-06-2004, 01:31 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,446
sde is on a distinguished road
ok thanks again
__________________
Mike
sde is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
to put data methods inside class or not? sde Java 2 05-25-2004 04:09 PM
Access denied for user: '@192.168.0.71' (Using password: NO) infinite_root PHP 11 04-28-2004 05:30 PM


All times are GMT -8. The time now is 11:38 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting