Skip to content

Instantly share code, notes, and snippets.

@yukithm
Last active November 8, 2019 01:37
Show Gist options
  • Save yukithm/2140193a1941582b2960e52ae9f92398 to your computer and use it in GitHub Desktop.
Save yukithm/2140193a1941582b2960e52ae9f92398 to your computer and use it in GitHub Desktop.
[kotlin] generateMysqlAesKey
fun generateMysqlAesKey(key: String): ByteArray {
val myKey = ByteArray(16)
key.forEachIndexed { i, c ->
myKey[i % 16] = (myKey[i % 16].xor(key[i].toByte()))
}
return myKey
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment