Security Extension

By PeterZhong at https://peterzhong1219.gitee.io

 

Security ExtensionVersionPermissionsDetailsEventsOnErrorOccuredOnRsaKeyPairGenratedMethodsBASE64EncodeBASE64DecodeGenerateRsaKeyPairGenerateAesKeyAesEncryptAesDecryptRsaEncryptRsaDecryptMD5HashSHA256SHA1PropertiesAesKeyRsaPrivateKeyRsaPublicKeyIV

 

Version

Permissions

Details

Events

OnErrorOccured

1550839725030

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.

OnRsaKeyPairGenrated

1550839737187

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.

 

Methods

BASE64Encode

1550839763779

This method is used to BASE64 encode a string.Input a plaintext

BASE64Decode

1550839794403

This method is used to BASE64 decode a string.Input a ciphertext

GenerateRsaKeyPair

1550839826883

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 RsaPrivateKeywill be set automatically.

GenerateAesKey

1550839854909

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 AesKeywill be set automatically.

AesEncrypt

1550840248745

Return the result after AES encrypt using the properties AesKey and IV.Input content,mode and padding.

AesDecrypt

1550840709359

Return the result after AES decrypt using the properties AesKey and IV.Input content,mode and padding.

RsaEncrypt

1550840802617

Return the RSA encrypt result using the property RsaPublicKey.Input the plaintext to encrypt with a public key.

RsaDecrypt

1550840921377

Return the RSA decrypt result using the property RsaPrivateKey.Input the ciphertext to encrypt with a private key.

MD5Hash

1550841091426

MD5 hash a string value(content),input content and uppercase(trueorfalse[boolean value]),it means the result is uppercase or not. Return a stirng with 32 characters,uppercase or lowercase.

SHA256

1550841268755

SHA256 hash a string.Input a string and it will return a string too.

SHA1

1550841335701

SHA1 hash a string.Input a string,and a boolean value is or not uppercase.

 

Properties

All properties can be set both in the Designer View and the Blocks View

AesKey

1550841591290

 

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).

RsaPrivateKey

1550842133196

You can set this property for the RSA decrypt method.It will be set automatically when RSA key pair is generated.

RsaPublicKey

1550842257126

A property for RSA encrypt method.It will be set automatically when RSA key pair is generated.

IV

A property for AES encrypt/decrypt method.It must be a string with 32 characters.

Download aix file here