SHAdigest (String function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (misc cleanup)
Line 14: Line 14:


==Usage notes==
==Usage notes==
<ul><li>SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions;  <var>SHAdigest</var> provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet.
<ul>
<li>SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions;  <var>SHAdigest</var> provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet. </li>
 
<li>This method is useful for storing one-way encrypted passwords in a file. SHA is considered unreversible. That is, the only   
<li>This method is useful for storing one-way encrypted passwords in a file. SHA is considered unreversible. That is, the only   
way to get a password given a digest is brute force: trying passwords until  
way to get a password given a digest is brute force: trying passwords until one produces the digest (more or less a hash) value. </li>
one produces the digest (more or less a hash) value.  
 
<li><var>SHAdigest</var> is available for use by <var class="product">[[Janus SOAP|Janus SOAP]]</var> or <var class="product">[http://www.sirius-software.com/maint/download/jansslr.pdf Janus Network Security]</var> customers.
<li><var>SHAdigest</var> is available for use by <var class="product">[[Janus SOAP|Janus SOAP]]</var> or <var class="product">[[Media:jansslr.pdf|Janus Network Security]]</var> customers. </li>
<li><var>SHAdigest</var> is available as of <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.3.</ul>
 
<li><var>SHAdigest</var> is available as of <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.3. </li>
</ul>


==Examples==
==Examples==
Line 30: Line 34:


==See also==
==See also==
<ul><li><var>[[MD5digest (String function)|MD5digest]]</var> returns the MD5 digest of the method object string, and <var>[[RC4encrypt (String function)|RC4encrypt]]</var> returns the RC4 encryption of the method object string.
<ul>
<li><var>[[MD5digest (String function)|MD5digest]]</var> returns the MD5 digest of the method object string, and <var>[[RC4encrypt (String function)|RC4encrypt]]</var> returns the RC4 encryption of the method object string. </li>
</ul>
</ul>
{{Template:String:SHAdigest footer}}
{{Template:String:SHAdigest footer}}

Revision as of 16:18, 28 August 2015

20-byte SHA digest (String class)


The SHAdigest intrinsic function returns the 20-byte (always) binary string that is the SHA digest of the method object string.

Syntax

%outString = string:SHAdigest

Syntax terms

%outString A string variable to receive the SHA digest of the method object string.
string The string to which the method is applied.

Usage notes

  • SHA (Secure Hash Algorithm) is a set of cryptographic hashing functions; SHAdigest provides SHA-1, the most commonly used. A complete explanation of SHA hashing can easily be found on the internet.
  • This method is useful for storing one-way encrypted passwords in a file. SHA is considered unreversible. That is, the only way to get a password given a digest is brute force: trying passwords until one produces the digest (more or less a hash) value.
  • SHAdigest is available for use by Janus SOAP or Janus Network Security customers.
  • SHAdigest is available as of Sirius Mods Version 7.3.

Examples

The 20-byte SHA hash of a string is typically expressed as a 40-digit hex value. In the following example, the output string from the SHAdigest method is converted to hex using the StringToHex intrinsic method:

printText {'this is a simple test':shadigest:stringtohex}

The result (displayed on two lines) is:

'this is a simple test':shadigest:stringtohex is BC38AA2D6769639946806616C14AF0C69477AABE

See also

  • MD5digest returns the MD5 digest of the method object string, and RC4encrypt returns the RC4 encryption of the method object string.