Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


HitCount Codacy Badge Scrutinizer Code Quality

Code size Lines of Code

jsAesCrypt is a Javascript file-encryption library and script that uses AES256-CBC to encrypt/decrypt files and binary files.

jsAesCrypt is compatible with the AES Crypt file format (version 2).

It is Free Software, released under the Apache License, Version 2.0.

jsAesCrypt is brought to you by Ilya Zedgenizov -

IMPORTANT SECURITY NOTE: version 2 of the AES Crypt file format does not authenticate the "file size modulo 16" byte. This implies that an attacker
with write access to the encrypted file may alter the corresponding plaintext file size by up to 15 bytes.

NOTE: there is no low-level memory management in Javascript, hence it is not possible to wipe memory areas were sensitive information was stored.


Library usage example

Here is an example showing encryption and decryption of a file:

// Init aesCrypt library
const aes = aesCrypt;

let fileSecret = document.getElementById("fileSecret").files[0];

let password = "foopassword"

// encryption/decryption

// encrypt typed array (Uint8Array)
aes.encrypt(fileSecret, password).then((encrypted) => {

let fileEncrypted = document.getElementById("fileEncrypted").files[0];

// decrypt typed array (Uint8Array)
aes.decrypt(fileEncrypted, password).then((decrypted) => {

  // transform Uint8Array to Latin1 string
  let secret = aes.utils.bytes2str(decrypted);

This is the most straightforward way to use jsAesCrypt, and should be preferred.


  • Is jsAesCrypt malware?

    NO! Of course it isn't!

    Nevertheless, being a library, it can be used by any other software, including malware.

    In fact, it has been reported that it is used as crypto library by some ransomware.

AES Crypt:

file format:

Apache License, Version 2.0: