Table of Contents

Search

  1. Preface
  2. Web Service Concepts
  3. Understanding the Web Services Provider
  4. Using the Web Services Hub Console
  5. Batch Web Service Operations
  6. Writing Client Applications
  7. Working with Web Service Sources and Targets
  8. Editing Web Service Sources and Targets
  9. Working with Web Service Mappings
  10. Working with Web Service Workflows
  11. Appendix A: Web Service Sample Client Applications
  12. Appendix B: Configure the Web Browser

Web Services Provider Guide

Web Services Provider Guide

Using Third-Party Tools to Create a Hashed Password

Using Third-Party Tools to Create a Hashed Password

You can use third-party tools, such as OpenSSL and the Java MessageDigest class, to create a hashed password.
OpenSSL on UNIX
To use OpenSSL to create a hashed password on a UNIX machine, run OpenSSL with the message digest command dgst.
The following example shows how to create a hashed password for the password string Administrator using the MD5 hash function and encoded in Base64:
echo -n "Administrator" | openssl dgst -md5 -binary | openssl base64
The following example shows how to create a hashed password for the password string Administrator using the SHA-1 hash function and encoded in Base64:
echo -n "Administrator" | openssl dgst -sha1 -binary | openssl base64
The echo command in these examples adds a newline character to the string. The -n option in the commands removes the newline character.
OpenSSL on Windows
To use OpenSSL to create a hashed password on a Windows machine, run OpenSSL with the message digest command dgst.
The following example shows how to create a hashed password using the SHA-1 hash function and encoded in Base64:
openssl dgst -sha1 -binary -out <output file name> <input file name> openssl enc –base64 –in <output file name>
The input file contains the password string that you want to hash. OpenSSL writes the hashed password to the output file.
Java MessageDigest
The following example shows how to use the Java MessageDigest class to create a hashed password using the MD5 hash function and encoded in Base64:
public static String md5hash(String password) throws Exception{ MessageDigest digest = java.security.MessageDigest.getInstance("MD5"); digest.reset(); digest.update(password.getBytes()); byte[] hash = digest.digest(); return new String(org.apache.commons.codec.binary.Base64.encodeBase64(hash)); }
The following example shows how to use the Java MessageDigest class to create a hashed password using the SHA-1 hash function and encoded in Base64:
public static String sha1hash(String password) throws Exception{ MessageDigest digest = java.security.MessageDigest.getInstance("SHA-1"); digest.reset(); digest.update(password.getBytes()); byte[] hash = digest.digest(); return new String(org.apache.commons.codec.binary.Base64.encodeBase64(hash)); }

0 COMMENTS

We’d like to hear from you!