Extension Name: File Cryptography
With the help of this extension, you can encrypt and decrypt files using AES Algorithm and 128bit Key (16 Characters). Key must be 16 characters, If not It will call onEncrypt/DecryptFail event.
2.Blocks
Events
Methods
3.Documentation
Events
AfterEncrypt
Event raised after encrypting the file.
inputfile ~ text
outputfile ~ text
key ~ text
AfterDecrypt
Event raised after decrypting the file.
inputfile ~ text
outputfile ~ text
key ~ text
OnEncryptFail
Event raised after encrypting failed.
error ~ text
code ~ integer
OnDecryptFail
Event raised after decrypting failed.
error ~ text
code ~ integer
Errors and Reasons
Formatted as Code - Error - Reason
InvalidKeyException - If Key is not 16 char. length.
NoSuchAlgorithmException - Will not throw this error.
NoSuchPaddingException - Will not throw this error.
IOException - File not exists, Wrong Decryption Password.
Methods/Functions
EncryptFile
Encrypts input file and save it as encrypted file using the provided key.
Calls OnEncryptFail if failed or AfterEncrypt if succeed.
inputfile ~ text (path)
outputfile ~ text (path)
key ~ text (used)
DecryptFile
Decrypts input file and save it as decrypted file using the provided key.
Calls OnDecryptFail if failed or AfterDecrypt if succeed.
inputfile ~ text (path)
outputfile ~ text (path)
key ~ text (used)
This extension is opensource and anyone can contribute to this extension.
6. Credits
I created this extension with the help of Rush. Without Rush, I could’ve not created this. Thanks to @Shreyash for Rush. Extension Documentation layout inspired from @vknow360.
No… It reduces the boiler plate code and easy to configure and build extension.
You can take a look at the repo for the project structure and configuration.
The path can be specified like either /storage/emulated/0/Downloads/sample.pdf or /Downloads/sample.pdf if UseAbsolutePath property is set to false.
I’ve been recently working on this extension and planning to move it out from the BETA stage. I just created a new test app to encrypt/decrypt files for testing. I’ll update the main post soon once I make it async ( currently freezes ui ) and the key issues. If you want to test it. Here you go.
It’s been a while since I’ve worked on it, and it’s still SYNC ( runs on a single thread and will freeze the UI ). That’s why I haven’t moved this from the beta phase ( haven’t got any time to work on this ), will patch things up soon.
and I don’t think this would be an efficient way to encrypt a 2GB file.