I'm trying to convert a String to a ByteArray, and convert the ByteArray to a String in Kotlin.
My program was crashing, so I decided to debug a little, and my surprise was that when I convert a String into a ByteArray and I convert the same ByteArray to a String, the value isn't the same.
Like, if I do this:
val ivEnc = "[B@9a7d34b"
val dataEnc = "[B@1125ac5"
passTextEncrypted.setText(ivEnc.toByteArray().toString())
passTextDecrypted.setText(dataEnc.toByteArray().toString())
I expect to recive "[B@9a7d34b" and "[B@1125ac5". But every time I run the program, I recive different "random" values (all start with "[B@").
Is there something I'm doing wrong?