Settings before encryption

Basic settings

Set the key to encrypt

  • setKey(“absolute key file path”);

In this case, all file paths must be absolute is as follows:

  • setKey(“C:\\Users\\guest\\ema\\key\\1710667676083099000_WLVGmMrEoHcdljvidTJQn8cvtjOF6M8w.key”);

or

  • setKey(“filename”);
  • setKeyFilesDirectory(“absolute key directory path”);

In this case, all file paths must be absolute is as follows:

  • setKey(“1710667676083099000_WLVGmMrEoHcdljvidTJQn8cvtjOF6M8w.key“);
  • setKeyFilesDirectory(“C:\\Users\\guest\\ema\\key\\”);

Create a key to encrypt

If the key has not been created and you need to create it is as follows:

  • keyCreation(0, “key file path”); // 0 means default (4.194.304-byte)

or

  • keyCreation(152_688, “C:\\Users\\guest\\ema\\key\\”);

creates a key file with 152.688 items to the ‘C:\Users\guest\ema\key\’ directory

To set the just created key in the same active session

  • setKey(“”);

The minimum setting to encrypt a byte array or file is correct

Other optional settings before performing encryption

Encryption execution is enabled by default

As a rule, it should never be disabled. If disabled, it is possible to see what the pre-encrypted data looks like and the .msk output file is not encrypted. Is always enabled by default.

  • disableEncryptionExecution();
  • enableEncryptionExecution();

Encryption details are enabled by default

If enabled, full encryption information is displayed.

  • disableEncryptionDetails();
  • enableEncryptionDetails();

Set the byte block size

This setting only affects the file encryption. The default byte block size is 2.097.152-byte. You can vary the size of the byte block from 64KB to 1GB. Changing the size of the byte block can affect the performance of encryption and decryption.

  • setByteBlockSize(65_536); // 64KB
  • setByteBlockSize(1_073_741_824); // 1GB

Encrypted file naming

This setting only affects the file encryption. The file naming of the encrypted file can be:

  1. name paired with key name
  2. random name (default)
  • encryptedFileNaming(‘P’); // ‘P’ or ‘p’ -> key pairing naming
  • encryptedFileNaming(‘r’); // ‘R’ or ‘r’ -> random naming

Enable the encryption checksum

By default the encryption checksum is enable. This means that the hash of the original byte array or file is written inside the encrypted file. The default algorithm is MD5.

To disable the encryption checksum (not reccomanded):

  • disableEncryptionChecksum();

To re-enable the encryption checksum:

  • enableEncryptionChecksum();

To modify the algorithm:

  • setEncryptionChecksumAlgorithm(3); // ‘MD5’ = 1, ‘SHA-256’ = 2 and ‘SHA-512’ = 3, default is ‘MD5’
Scroll to Top