{"action":"created","issue":{"url":"https://api.github.com/repos/brix/crypto-js/issues/33","labels_url":"https://api.github.com/repos/brix/crypto-js/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/brix/crypto-js/issues/33/comments","events_url":"https://api.github.com/repos/brix/crypto-js/issues/33/events","html_url":"https://github.com/brix/crypto-js/issues/33","id":96837939,"number":33,"title":"Unable to decrypt via AES","user":{"login":"andrewjmead","id":2992789,"avatar_url":"https://avatars.githubusercontent.com/u/2992789?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewjmead","html_url":"https://github.com/andrewjmead","followers_url":"https://api.github.com/users/andrewjmead/followers","following_url":"https://api.github.com/users/andrewjmead/following{/other_user}","gists_url":"https://api.github.com/users/andrewjmead/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewjmead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewjmead/subscriptions","organizations_url":"https://api.github.com/users/andrewjmead/orgs","repos_url":"https://api.github.com/users/andrewjmead/repos","events_url":"https://api.github.com/users/andrewjmead/events{/privacy}","received_events_url":"https://api.github.com/users/andrewjmead/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T15:17:22Z","updated_at":"2015-07-23T15:19:38Z","closed_at":null,"body":"I dug around, but I wasn't able to figure out why my example is not running. I saw the example for aes at the bottom of the file https://github.com/brix/crypto-js/blob/master/aes.js#L218.\r\n\r\n\r\n\r\n```\r\nvar CryptoJS = require(\"crypto-js\");\r\n\r\nvar message = 'test';\r\nvar key = '1234abcd0998ijdf';\r\nvar cfg = {};\r\n\r\nvar ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\r\nvar plaintext  = CryptoJS.AES.decrypt(ciphertext, key, cfg);\r\n\r\nconsole.log(plaintext);\r\n```\r\n\r\nThe output is not plain text, its:\r\n\r\n```\r\n{ words: [ 1952805748, 202116108, 202116108, 202116108 ],\r\n  sigBytes: 4 }\r\n```\r\n\r\nCalling `toString()` on the object returns `74657374`. Any idea where I'm going wrong?"},"comment":{"url":"https://api.github.com/repos/brix/crypto-js/issues/comments/124137723","html_url":"https://github.com/brix/crypto-js/issues/33#issuecomment-124137723","issue_url":"https://api.github.com/repos/brix/crypto-js/issues/33","id":124137723,"user":{"login":"andrewjmead","id":2992789,"avatar_url":"https://avatars.githubusercontent.com/u/2992789?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewjmead","html_url":"https://github.com/andrewjmead","followers_url":"https://api.github.com/users/andrewjmead/followers","following_url":"https://api.github.com/users/andrewjmead/following{/other_user}","gists_url":"https://api.github.com/users/andrewjmead/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewjmead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewjmead/subscriptions","organizations_url":"https://api.github.com/users/andrewjmead/orgs","repos_url":"https://api.github.com/users/andrewjmead/repos","events_url":"https://api.github.com/users/andrewjmead/events{/privacy}","received_events_url":"https://api.github.com/users/andrewjmead/received_events","type":"User","site_admin":false},"created_at":"2015-07-23T15:19:38Z","updated_at":"2015-07-23T15:19:38Z","body":"Just figured it out that's to this stack overflow question http://stackoverflow.com/questions/18055123/decrypt-using-cryptojs-not-working.\r\n\r\nResulting test program:\r\n\r\n```\r\nvar CryptoJS = require(\"crypto-js\");\r\n\r\nvar message = 'test';\r\nvar key = '1234abcd0998ijdf';\r\nvar cfg = {};\r\n\r\nvar ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\r\nvar plaintext  = CryptoJS.AES.decrypt(ciphertext.toString(), key, cfg);\r\n\r\nconsole.log(plaintext.toString(CryptoJS.enc.Utf8));\r\n```"}}