• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Password encryption

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am able to add a user to the jforum_users table using the JDBC API as follows:

PreparedStatement s = conn.prepareStatement("INSERT INTO jforum_users (username, user_password, user_regdate) VALUES(?, ?, ?)");
s.setString(1, user);
s.setString(2, pw );
s.setTimestamp(3, myDate);
int count = s.executeUpdate(stmt);

However, the password field isn't encrypted. What do I need to do to encrypt this field so that it's compatible with the JForum UI Login page?

Thanks,
Jeff

[originally posted on jforum.net by netbracketsJeff]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use:

s.setString(2, net.jforum.utils.MD5.crypt(pwd));

(assumes a non null / blank pwd).
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,
Is net.jforum.utils.* part of the source download, or is the a jar somewhere that I can import.

Thanks,
Jeff
[originally posted on jforum.net by netbracketsJeff]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, I "jar"ed up the class files under jforum/WEB-INF/classes and added it to my classpath, and it worked! Thanks, never would have figured that out without some help.

Thanks,
Jeff
[originally posted on jforum.net by netbracketsJeff]
 
Get me the mayor's office! I need to tell her about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic