<head><title>ColdC: Function/Method Reference: crypt()</title></head> <body> <h1 align=center><a href="/ColdC/">ColdC</a>: <a href="/ColdC/Functions/">Function/Method Reference</a>: crypt()</h1> <hr> <p> <font size=+1><i>STRING</i> <b>crypt</b>(<i>STRING <b>str</b>, STRING <b>salt</b></i>)</font> <p>This function performs one-way encryption on <VAR>str</VAR>, using the host system's <CODE>crypt()</CODE> library routine. If <VAR>salt</VAR> is specified, then it must be a two-character string; otherwise, a salt is chosen randomly. The return value of <CODE>crypt()</CODE> is the encrypted string. <P>The encryption performed by this function has the property that it is very difficult to find a string which will produce a given result; however, a given string and a given salt will always yield the same encrypted string. <P>Examples: <blockquote> <PRE> crypt("foo", "ab") => "abQ9KY.KfrYrc" </PRE> </blockquote> <p><hr size=4><p align=center><i>Last Modified on 24 Mar 1996</i> <br><i>Copyright © 1995, 1996, Brandon Gillespie</i> </body>