Package org.mycore.common
Class MCRCrypt
java.lang.Object
org.mycore.common.MCRCrypt
Java-based implementation of the unix crypt(3) command
Based upon C source code written by Eric Young, eay@psych.uq.oz.au Java
conversion by John F. Dumas, jdumas@zgs.com
Found at http://locutus.kingwoodcable.com/jfd/crypt.html Minor optimizations
by Wes Biggs, wes@cacas.org Adaption and extension for the MyCoRe Open Source
System by Detlev Degenhardt, Detlev.Degenhardt@rz.uni-freiburg.de
Eric's original code is licensed under the BSD license. As this is
derivative, the same license applies.
- Version:
- $Revision$ $Date$
- Author:
- Detlev Degenhardt
-
Field Summary
-
Method Summary
-
Field Details
-
ALPHABET
- See Also:
-
-
Method Details
-
crypt
This method encrypts a string given a cleartext string and a "salt".- Parameters:
salt
- A two-character string representing the salt used to iterate the encryption engine.original
- The string to be encrypted.- Returns:
- A string consisting of the 2-character salt followed by the encrypted string.
-
crypt
This method encrypts a string given the cleartext string. A random salt is generated using java.util.Random.- Parameters:
original
- The string to be encrypted.- Returns:
- A string consisting of the 2-character salt followed by the encrypted string.
-