Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

RC5MBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class Encryption and Hash MBS Encryption Plugin 15.4 Yes Yes Yes Yes No
Function: The class for RC5 encryption.
Example:
dim r as RC5MBS

// Encrypt:
r = new RC5MBS("Key")

dim iv as MemoryBlock
dim num as Integer
dim OriginalData as string = ConvertEncoding("Hello World!", encodings.UTF8)
dim EncryptedData as string = r.encryptCFB64(OriginalData, iv, num)
MsgBox EncodeHex(EncryptedData)

// Same for decrypt:
r = new RC5MBS("Key")

iv = nil
num = 0
dim UnencryptedData as string = r.decryptCFB64(EncryptedData, iv, num)
UnencryptedData = DefineEncoding(UnencryptedData, encodings.UTF8)
MsgBox UnencryptedData
Notes:
Do use to read existing RC5 encrypted things.
New projects may better use a better encryption.

Feedback, Comments & Corrections

  • 16 methods
    • method Constructor(key as MemoryBlock, rounds as Integer = 16)
    • method Constructor(key as string, rounds as Integer = 16)
    • method decrypt(data as Memoryblock) as Memoryblock
    • method decrypt(data as string) as string
    • method decryptCBC(data as Memoryblock, iv as memoryblock = nil) as Memoryblock
    • method decryptCBC(data as string, iv as memoryblock = nil) as string
    • method decryptCFB64(data as Memoryblock, iv as memoryblock, byref num as Integer) as Memoryblock
    • method decryptCFB64(data as string, iv as memoryblock, byref num as Integer) as string
    • method encrypt(data as Memoryblock) as Memoryblock
    • method encrypt(data as string) as string
    • method encryptCBC(data as Memoryblock, iv as memoryblock = nil) as Memoryblock
    • method encryptCBC(data as string, iv as memoryblock = nil) as string
    • method encryptCFB64(data as Memoryblock, iv as memoryblock, byref num as Integer) as Memoryblock
    • method encryptCFB64(data as string, iv as memoryblock, byref num as Integer) as string
    • method encryptOFB64(data as Memoryblock, iv as memoryblock, byref num as Integer) as Memoryblock
    • method encryptOFB64(data as string, iv as memoryblock, byref num as Integer) as string

This class has no sub classes.


The items on this page are in the following plugins: MBS Encryption Plugin.


RC4MBS   -   RecordSet




Links
MBS Xojo Chart Plugins