Moscrif API Docs for: 2012q3
Show:

AES Class

Library: crypto

This class represents implementations of the Advanced Encryption Standard (AES). Advanced Encryption Standard is a specification for the encryption of electronic data using symmetric-key algorithm, what means that the same key is used for both encrypting and decrypting.

Example:

//dat://input.txt contains: Moscrif is the best cross-platform SDK.
AES.fileEncrypt("dat://input.txt", "dat://output.txt", "password");

//dat://output.txt contains crypted data in binary format
AES.fileDecrypt("dat://output.txt", "dat://decrepted.txt", "password");

//dat://decrepted.txt contains: Moscrif is the best cross-platform SDK

Item Index

Methods

fileDecrypt

(
  • input
  • output
  • pasword
)

This function decrypts file and save result to output file. If output file does not exist a new one is created.

Parameters:

  • input String

    Source file.

  • output String

    Encrypted file.

  • pasword String

    The password key.

Example:

//dat://output.txt contains crypted data in binary format
AES.fileDecrypt("dat://output.txt", "dat://decrepted.txt", "password");

//dat://decrepted.txt contains: Moscrif is the best cross-platform SDK.

fileEncrypt

(
  • input
  • output
  • key
)

This function encrypts source file by Advanced Encryption Standard. The result is saved to output file. If output file does not exist, a new one is created.

Parameters:

Example:

//dat://input.txt contains: Moscrif is the best cross-platform SDK.
AES.fileEncrypt("dat://input.txt", "dat://output.txt", "password");

//dat://output.txt contains crypted data in binary format