Core Function EncryptString
From Sputnik Wiki
(Difference between revisions)
(→Remarks) |
(→Example) |
||
Line 34: | Line 34: | ||
$EncryptedString = EncryptString($Msg, $Password); | $EncryptedString = EncryptString($Msg, $Password); | ||
$DecryptedString = DecryptString($EncryptedString, $Password); | $DecryptedString = DecryptString($EncryptedString, $Password); | ||
− | Printf("Message: {0}\n",$Msg); | + | Printf("Message: \{0}\n",$Msg); |
− | Printf("Password: {0}\n",$Password); | + | Printf("Password: \{0}\n",$Password); |
− | Printf("Encrypted string: {0}\n",$EncryptedString); | + | Printf("Encrypted string: \{0}\n",$EncryptedString); |
− | Printf("Decrypted string: {0}\n",$DecryptedString); | + | Printf("Decrypted string: \{0}\n",$DecryptedString); |
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Core Function]] | [[Category:Core Function]] |
Revision as of 19:28, 20 August 2013
EncryptString( <expression>, <password> )
Contents |
Description
Encrypt a string with a given password.
Parameters
expression
The string to encrypt.
password
The password to encrypt it with.
Return Value
Success: Returns encrypted string.
Failure: Returns empty string.
Remarks
It uses a secure TripleDES.
Example
$Msg = "This is my secret message for sure yea"; $Password = "secret"; $EncryptedString = EncryptString($Msg, $Password); $DecryptedString = DecryptString($EncryptedString, $Password); Printf("Message: \{0}\n",$Msg); Printf("Password: \{0}\n",$Password); Printf("Encrypted string: \{0}\n",$EncryptedString); Printf("Decrypted string: \{0}\n",$DecryptedString);