Core Function DecryptString

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> DecryptString( <expression>, <password> ) </pre> === Description === Decrypt a string with a given password. === Parameters === ==== expression ==== The string to decr...")
 
Line 38: Line 38:
 
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>
 
 
Example with cast on a $variable
 
 
<syntaxhighlight lang="sputnik">
 
$var = 1033;
 
 
$result = Hex((int)$var);
 
println($result); // prints "409"
 
 
$result = Hex((int)$var, 4);
 
println($result); // prints "0409"
 
 
$result = Hex((int)$var, 8);
 
println($result); // prints "00000409"intln($result); // prints "409"
 
 
$result = Hex(1033, 4);
 
println($res
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Revision as of 20:27, 30 November 2011

DecryptString( <expression>, <password> )

Contents

Description

Decrypt a string with a given password.

Parameters

expression

The string to decrypt.

password

The password to decrypt it with.

Return Value

Success: Returns decrypted string.

Failure: Returns empty string.

Remarks

None.

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);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox