{"action":"created","issue":{"url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/19","labels_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/19/comments","events_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/19/events","html_url":"https://github.com/tozny/java-aes-crypto/issues/19","id":112609313,"number":19,"title":"MAC stores in civ does not match computed MAC","user":{"login":"LeHaine","id":4951150,"avatar_url":"https://avatars.githubusercontent.com/u/4951150?v=3","gravatar_id":"","url":"https://api.github.com/users/LeHaine","html_url":"https://github.com/LeHaine","followers_url":"https://api.github.com/users/LeHaine/followers","following_url":"https://api.github.com/users/LeHaine/following{/other_user}","gists_url":"https://api.github.com/users/LeHaine/gists{/gist_id}","starred_url":"https://api.github.com/users/LeHaine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeHaine/subscriptions","organizations_url":"https://api.github.com/users/LeHaine/orgs","repos_url":"https://api.github.com/users/LeHaine/repos","events_url":"https://api.github.com/users/LeHaine/events{/privacy}","received_events_url":"https://api.github.com/users/LeHaine/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-10-21T14:59:35Z","updated_at":"2015-10-21T16:26:07Z","closed_at":"2015-10-21T16:09:11Z","body":"Hello guys! Thanks for the awesome library. I am running into an issue with decrypting a string that is stored in Preferences. \r\n\r\nSo what I am doing is generating a key based on a password and storing the salt. I regenerate the key whenever I need access to it. What I am trying to do those is decrypt the encrypted string without the CiperTextIvMac available.\r\n\r\nSo an example:\r\n\r\nI get plain text -> encrypt it -> store on shared preferences.\r\nOpen app up a later time after it has been completely closed -> retrieve encrypted string from preferences -> decrypt string -> get plain text.\r\n\r\nBut what happens when I try to decrypt is\r\n```\r\njava.security.GeneralSecurityException: MAC stored in civ does not match computed MAC.\r\n10-21 10:54:40.084  15146-15146/app_android W/System.err﹕ at app_android.security.AesCbcWithIntegrity.decrypt(AesCbcWithIntegrity.java:368)\r\n10-21 10:54:40.084  15146-15146/app_android W/System.err﹕ at app_android.security.AesCbcWithIntegrity.decryptString(AesCbcWithIntegrity.java:331)\r\n10-21 10:54:40.084  15146-15146/app_android W/System.err﹕ at app_android.security.AesCbcWithIntegrity.decryptString(AesCbcWithIntegrity.java:346)\r\n```\r\nHere is my code to decrypt:\r\n```\r\nString salt = getSalt();\r\nAesCbcWithIntegrity.SecretKeys keys =   AesCbcWithIntegrity.generateKeyFromPassword(Constants.KEY, salt);\r\ndecryptedUsername = AesCbcWithIntegrity.decryptString(new   AesCbcWithIntegrity.CipherTextIvMac(username), keys);\r\n```\r\n\r\nNot sure if I am missing something obvious. But thanks for the help.\r\n"},"comment":{"url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/comments/149951777","html_url":"https://github.com/tozny/java-aes-crypto/issues/19#issuecomment-149951777","issue_url":"https://api.github.com/repos/tozny/java-aes-crypto/issues/19","id":149951777,"user":{"login":"SyntaxPolice","id":564819,"avatar_url":"https://avatars.githubusercontent.com/u/564819?v=3","gravatar_id":"","url":"https://api.github.com/users/SyntaxPolice","html_url":"https://github.com/SyntaxPolice","followers_url":"https://api.github.com/users/SyntaxPolice/followers","following_url":"https://api.github.com/users/SyntaxPolice/following{/other_user}","gists_url":"https://api.github.com/users/SyntaxPolice/gists{/gist_id}","starred_url":"https://api.github.com/users/SyntaxPolice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SyntaxPolice/subscriptions","organizations_url":"https://api.github.com/users/SyntaxPolice/orgs","repos_url":"https://api.github.com/users/SyntaxPolice/repos","events_url":"https://api.github.com/users/SyntaxPolice/events{/privacy}","received_events_url":"https://api.github.com/users/SyntaxPolice/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T16:26:07Z","updated_at":"2015-10-21T16:26:07Z","body":"Ha! Thanks for working through the problem. I'm glad you got it working.\n\nCan you share any information about what you're using the library for? We\nare always interested in how are users use it.\n\npeace,\n\n  Isaac, sent from a mobile device\nOn Oct 21, 2015 10:09 AM, \"Colt\" <notifications@github.com> wrote:\n\n> Wow nevermind I am dumb. I though I added in the code to store the salt\n> but I did not. EVERYTHING WORKS AS IT SHOULD.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/tozny/java-aes-crypto/issues/19#issuecomment-149947202>\n> .\n>\n"}}