You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2011/03/19 01:27:55 UTC

[Couchdb Wiki] Update of "Security_Features_Overview" by PaulMietzEgli

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Security_Features_Overview" page has been changed by PaulMietzEgli.
The comment on this change is: added example code for generating password digest with Java.
http://wiki.apache.org/couchdb/Security_Features_Overview?action=diff&rev1=21&rev2=22

--------------------------------------------------

  {{{
  hex_sha1(foobar);
  }}}
+ 
+ Java (using [[http://www.jasypt.org/|Jasypt]] library)
+ {{{
+ import org.jasypt.digest.StandardStringDigester;
+ 
+ StringDigester digester = new StandardStringDigester();
+ digester.setAlgorithm("SHA-1");
+ digester.setIterations(1);
+ digester.setStringOutputType("hexadecimal");
+ digester.setSaltSizeBytes(0);
+ String digested = digester.digest("foobar").toLowerCase();  // 8843d7f92416211de9ebb963ff4ce28125932878
+ }}}
  ==== Salt and Password Generator ====
  This Perl script expects a password on STDIN or as its first parameter, and an optional salt as its second parameter. If no salt is provided, a random one will be selected.