iOS Question iEncrypt err

yejian

Member
Licensed User
Longtime User
Dim jm As Cipher
Dim data(0) As Byte
Dim text As String
data="test-text".GetBytes("utf8")
data = jm.Encrypt(data, "123")
Log(data)
text=BytesToString(data,0,data.Length,"UTF-8")
log(text)


Application_Start
<B4IArray: 0x166a2750>
Error occurred on line: 33 (Main)
Error decoding data as string.
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
B4i Example -[B4ICommon BytesToString::::] + 398
B4i Example -[b4i_main _application_start:] + 1616
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 292
B4i Example +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1788
B4i Example -[B4IShell runMethod:] + 496
B4i Example -[B4IShell raiseEventImpl:method:args::] + 1768
B4i Example -[B4IShellBI raiseEvent:event:params:] + 1332
B4i Example __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 1532
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1590
CoreFoundation CFRunLoopRunSpecific + 516
CoreFoundation CFRunLoopRunInMode + 108
GraphicsServices GSEventRunModal + 160
UIKit UIApplicationMain + 144
B4i Example main + 108
libdyld.dylib <redacted> + 2
)
Application_Active
 

yejian

Member
Licensed User
Longtime User
The encrypted data doesn't represent a valid string. It is a "random" bytes.

You should instead use ByteConverter.HexFromBytes to convert the raw bytes to a string.

What encryption method can be used B4I?can decrypt, similar to AES
 
Upvote 0
Top