0

I found AES encryption logic in Kotlin by using JavaX libraries. Since it's specific to java (Android) so it's not executing for iOS.

  • I'm sorry but I do see no question in your post. As noticed in the main website of kotlin: "*You only need to write platform-specific code where it’s necessary, for example to implement a native UI or when working with platform-specific APIs.*". And yes, the encryption is implemented in platform specific APIs. – Michael Fehr Dec 28 '21 at 08:39

1 Answers1

0

You can use krypto or libsodum wrapper libraries.

For example, with krypto library you can easily implement AES CBC in commanMain module by using these functions:

implementation("com.soywiz.korlibs.krypto:krypto:${Version.krypto}")



AES.encryptAesEcb(dataByteArray, keyByteArray, Padding.NoPadding)
AES.decryptAesEcb(dataByteArray, keyByteArray, Padding.ANSIX923Padding)
makif
  • 132
  • 2
  • 11