Commands & Syntax > Commands > File Mainpulation >

ENCRYPT/DECRYPT - < file_encryption >() ... [Pro]

www.perfectkeyboard.com

 

File ENCRYPT/DECRYPT
<file_encryption>("Input","Output",Information,Encryption bit strength,"Password")
Available in: Professional edition

This command encrypts/decrypts a single file.

 

#

Parameter name

Parameter description

1

Input

(Full) path to a file that is to be encrypted/decrypted. Example: c:\temp\myPrivateInfo.txt.

2

Output

(Full) path to a file that is created as a result of the encryption/decryption of the "Input File". Example: c:\temp\myPrivateInfo.txt.aes.

3

Information

This parameter can be one of these:
ENCRYPT_AES - the input file is encrypted using AES.
DECRYPT_AES - the input file (previously encrypted using ENCRYPT_AES) is decrypted.

4

Encryption bit strength

Strength of the encryption. These values are supported: 128, 192, 256.

5

Password

User defined password that is used to encrypt/decrypt the input file. A file encrypted by a password can be successfully decrypted again only if the same password is used.

 

Example (Macro Steps):

 

1

<#> <#> This simple example shows how to encrypt/decrypt file.

2

<#> <#>

3

Macro execution: ONLY COMMANDS

4

<#> <#> Create folder for sample files

5

Folder CREATE "c:\temp\file_encryption_sample"

6

<#> <#> Create sample file

7

File SAVE TEXT "This is a sample file." to file "c:\temp\file_encryption_sample\1.file_original.txt

8

<#> <#> Now encrypt the file...

9

File ENCRYPT/DECRYPT Input = "c:\temp\file_encryption_sample\1.file_original.txt", Output = "c:\temp\file_encryption_sample\2.file_encrypted.txt", Information = "ENCRYPT_AES", Encryption bit strength = "128"

10

<#> <#> ...and decrypt again

11

File ENCRYPT/DECRYPT Input = "c:\temp\file_encryption_sample\2.file_encrypted.txt", Output = "c:\temp\file_encryption_sample\3.file_decrypted.txt", Information = "DECRYPT_AES", Encryption bit strength = "128"

12

<#> <#> Open folder to see the results

13

Folder OPEN open folder "c:\temp\file_encryption_sample" in Windows Explorer.

Example (Plain Text):

 

<#> This simple example shows how to encrypt/decrypt file.

<#>

<cmds>

 

<#> Create folder for sample files

<dircreate>("c:\temp\file_encryption_sample",0)

 

<#> Create sample file

<data_save>("This is a sample file.","c:\temp\file_encryption_sample\1.file_original.txt","")

 

<#> Now encrypt the file...

<file_encryption>("c:\temp\file_encryption_sample\1.file_original.txt","c:\temp\file_encryption_sample\2.file_encrypted.txt",ENCRYPT_AES,128,"nyrangers")

 

<#> ...and decrypt again

<file_encryption>("c:\temp\file_encryption_sample\2.file_encrypted.txt","c:\temp\file_encryption_sample\3.file_decrypted.txt",DECRYPT_AES,128,"nyrangers")

 

<#> Open folder to see the results

<diropen>("c:\temp\file_encryption_sample",0)