SHAdigest (String function): Difference between revisions
Jump to navigation
Jump to search
m (→Usage notes) |
|||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:String:SHAdigest subtitle}} | {{Template:String:SHAdigest subtitle}} | ||
The <var>SHAdigest</var> [[Intrinsic classes|intrinsic]] function returns the 20-byte (always) binary string that is the SHA digest of the method object string. | The <var>SHAdigest</var> [[Intrinsic classes|intrinsic]] function returns the 20-byte (always) binary string that is the SHA-1 digest of the method object string. | ||
==Syntax== | ==Syntax== | ||
{{Template:String:SHAdigest syntax}} | {{Template:String:SHAdigest syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table | <table> | ||
<tr><th>%outString</th> | <tr><th>%outString</th> | ||
<td>A string variable to receive the SHA digest of the method object <var class="term">string</var>.</td></tr> | <td>A string variable to receive the SHA-1 digest of the method object <var class="term">string</var>.</td></tr> | ||
<tr><th>string</th> | <tr><th>string</th> | ||
<td>The string to which the method is applied.</td></tr> | <td>The string to which the method is applied.</td></tr> | ||
Line 14: | Line 16: | ||
==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, which was the most commonly used. SHA-1 is no longer recommended for the signing of Internet security certificates. 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"> | <li><var>SHAdigest</var> is available for use by <var class="product">Model 204</var> V7.5 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== | ||
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 <var>SHAdigest</var> method is converted to hex using the [[StringToHex (String function)|StringToHex]] intrinsic method: | The 20-byte SHA-1 hash of a string is typically expressed as a 40-digit hex value. In the following example, the output string from the <var>SHAdigest</var> method is converted to hex using the <var>[[StringToHex (String function)|StringToHex]]</var> intrinsic method: | ||
<p class=" | <p class="code">[[PrintText statement|printText]] {~} is {'this is a simple test':shadigest:stringtohex} | ||
</p> | </p> | ||
The result | The result is: | ||
<p class="output">'this is a simple test':shadigest:stringtohex is BC38AA2D6769639946806616C14AF0C69477AABE | <p class="output">'this is a simple test':shadigest:stringtohex is BC38AA2D6769639946806616C14AF0C69477AABE | ||
</p> | </p> | ||
==See also== | ==See also== | ||
<ul><li>< | <ul> | ||
<li>Additional hashes: | |||
<ul> | |||
{{Template:Digest methods}} | |||
</ul></li> | |||
<li>Two-way ciphers: | |||
<ul> | |||
{{Template:AES crypto methods}} | |||
{{Template:DEA crypto methods}} | |||
<li>[[RC4decrypt and RC4encrypt (String functions)]] </li> | |||
</ul></li> | |||
</ul> | </ul> | ||
{{Template:String:SHAdigest footer}} | {{Template:String:SHAdigest footer}} |
Latest revision as of 04:19, 11 April 2016
20-byte SHA digest (String class)
The SHAdigest intrinsic function returns the 20-byte (always) binary string that is the SHA-1 digest of the method object string.
Syntax
%outString = string:SHAdigest
Syntax terms
%outString | A string variable to receive the SHA-1 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, which was the most commonly used. SHA-1 is no longer recommended for the signing of Internet security certificates. 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 Model 204 V7.5 or Janus Network Security customers.
- SHAdigest is available as of Sirius Mods Version 7.3.
Examples
The 20-byte SHA-1 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 {~} is {'this is a simple test':shadigest:stringtohex}
The result is:
'this is a simple test':shadigest:stringtohex is BC38AA2D6769639946806616C14AF0C69477AABE
See also
- Additional hashes:
- Two-way ciphers:
- AES128decrypt and AES128encrypt (String functions)
- AES192decrypt and AES192encrypt (String functions)
- AES256decrypt and AES256encrypt (String functions)
- AES128CBCdecrypt and AES128CBCencrypt (String functions)
- AES192CBCdecrypt and AES192CBCencrypt (String functions)
- AES256CBCdecrypt and AES256CBCencrypt (String functions)
- DEA64decrypt and DEA64encrypt (String functions)
- DEA128decrypt and DEA128encrypt (String functions)
- DEA192decrypt and DEA192encrypt (String functions)
- DEA64CBCdecrypt and DEA64CBCencrypt (String functions)
- DEA128CBCdecrypt and DEA128CBCencrypt (String functions)
- DEA192CBCdecrypt and DEA192CBCencrypt (String functions)
- RC4decrypt and RC4encrypt (String functions)