By PeterZhong at https://peterzhong1219.gitee.io
Security ExtensionVersionPermissionsDetailsEventsOnErrorOccuredOnRsaKeyPairGenratedMethodsBASE64EncodeBASE64DecodeGenerateRsaKeyPairGenerateAesKeyAesEncryptAesDecryptRsaEncryptRsaDecryptMD5HashSHA256SHA1PropertiesAesKeyRsaPrivateKeyRsaPublicKeyIV
xxxxxxxxxx
This is an extension about security for App Inventor and Thunkable,and it is also my first real extension.It provides MD5 hash,SHA1 and SHA256 hash,AES encrypt/decrypt,RSA encrypt/decrypt,BASE64 encode/decode method.More method will be added in the future.
xxxxxxxxxx
This extension doesn't need any permissions.
This event will be trigger when any exception was throwed.There are two variable in this event:method and message.The variable "method" is the name of the method where the error occured.The variable "message" is the message of the exceptiom.
This event will be trigger when the RSA key pair generated successfully.If the key pair generated unsuccessfully,the "OnErrorOccured" event will be trigger instead of this one.There are two variable,the RSA private key and the RSA public key.
This method is used to BASE64 encode a string.Input a plaintext
This method is used to BASE64 decode a string.Input a ciphertext
This method is used to generate a pair of RSA encrypt/decrypt key(including a private key and a public key
),input the size of the key,its unit is bit
.it can be 512,1024,2048 or 4096.The longer the key is,the safer it will be.When the key pair has been generated,the event OnRsaKeyPairGenerated
will be trigger and pass two variable.At the same time,the properties RsaPublicKey
and RsaPrivateKey
will be set automatically.
This method is used to generate a key for AES encrypt/decrypt.Input the size of the key,its unit is bit
,it can be 128,192 or 256.The longer the key is,the safer it will be.It will return a string value.This is the result of the BASE64 encoding of the key value.And the property AesKey
will be set automatically.
Return the result after AES encrypt using the properties AesKey
and IV
.Input content,mode and padding.
PKCS5Padding
,PKCS7Padding
,ISO10126
or ANSIX923
ECB
,CBC
,CTR
,OFB
or CFB
ECB
encrypt mode,this value isn't needed,else you must set this property.
Return the result after AES decrypt using the properties AesKey
and IV
.Input content,mode and padding.
PKCS5Padding
,PKCS7Padding
,ISO10126
or ANSIX923
ECB
,CBC
,CTR
,OFB
or CFB
ECB
encrypt mode,this value isn't needed,else you must set this property.Return the RSA encrypt result using the property RsaPublicKey
.Input the plaintext to encrypt with a public key.
Return the RSA decrypt result using the property RsaPrivateKey
.Input the ciphertext to encrypt with a private key.
MD5 hash a string value(content
),input content and uppercase(true
orfalse
[boolean value]),it means the result is uppercase or not. Return a stirng with 32 characters,uppercase or lowercase.
SHA256 hash a string.Input a string and it will return a string too.
SHA1 hash a string.Input a string,and a boolean value is or not uppercase.
All properties can be set both in the Designer View and the Blocks View
You can set this property for the AES encrypt/decrypt method.It will be set automatically when AES key is generated(The method GenerateAesKey
is called successfully).
You can set this property for the RSA decrypt method.It will be set automatically when RSA key pair is generated.
A property for RSA encrypt method.It will be set automatically when RSA key pair is generated.
A property for AES encrypt/decrypt method.It must be a string with 32 characters.
Download aix file here