B4A Library [B4X] B4XEncryption

Status
Not open for further replies.
This library allows you to encrypt or decrypt data using the AES encryption method.

To prevent confusion, B4XEncryptino is not a b4xlib and is made of three platform specific libraries:
B4XEncryption - B4A
jB4XEncryption - B4J
iEncryption - B4i (Encrypt and Decrypt methods)

It is simple to use and is cross platform, which means that you can encrypt the data on one platform and decrypt it on a different platform.

Usage example:
B4X:
Sub EncryptText(text As String, password As String) As Byte()
   Dim c As B4XCipher
   Return c.Encrypt(text.GetBytes("utf8"), password)
End Sub

Sub DecryptText(EncryptedData() As Byte, password As String) As String
   Dim c As B4XCipher
   Dim b() As Byte = c.Decrypt(EncryptedData, password)
   Return BytesToString(b, 0, b.Length, "utf8")
End Sub

Dim encryptedData() As Byte = EncryptText("confidential", "123456")
Log(DecryptText(encryptedData, "123456"))

B4XPages example project is attached.
 

Attachments

  • Project.zip
    14 KB · Views: 1,003
Last edited:

Chris Lee

Member
Licensed User
Status
Not open for further replies.
Top