Perl functions references-crypt Function - Perl Scripting

what is the use of Perl crypt Function?


This function encrypts the string EXPR using the system crypt( ) function. The value of SALT is used to select an encrypted version from one among the variations.
You cannot decrypt a string that has been encrypted in this way. It's normally used one way, first to encrypt a string, and then to encrypt a password to compare against the encrypted string. If you're using it in this form, then consider supplying the encrypted password as the SALT.


Following is the simple syntax for this function −

Return Value

This function returns the encrypted string.


Following is the example code showing its basic usage, it makes sure that whoever runs this program knows their password::
When above code is executed, it produces the following result −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Perl Scripting Topics