Skip to content

Instantly share code, notes, and snippets.

@yakivmospan
Created November 1, 2017 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yakivmospan/6f8e5372b917d3344bc769f9b21e45dc to your computer and use it in GitHub Desktop.
Save yakivmospan/6f8e5372b917d3344bc769f9b21e45dc to your computer and use it in GitHub Desktop.
fun decrypt(data: String, key: Key?): String {
cipher.init(Cipher.DECRYPT_MODE, key)
val encryptedData = Base64.decode(data, Base64.DEFAULT)
val decodedData = cipher.doFinal(encryptedData)
return String(decodedData)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment