{"action":"closed","issue":{"url":"https://api.github.com/repos/jedisct1/libsodium.js/issues/172","repository_url":"https://api.github.com/repos/jedisct1/libsodium.js","labels_url":"https://api.github.com/repos/jedisct1/libsodium.js/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/jedisct1/libsodium.js/issues/172/comments","events_url":"https://api.github.com/repos/jedisct1/libsodium.js/issues/172/events","html_url":"https://github.com/jedisct1/libsodium.js/issues/172","id":364428026,"node_id":"MDU6SXNzdWUzNjQ0MjgwMjY=","number":172,"title":"box_seal_open - Uncaught (in promise) TypeError: invalid ciphertext length","user":{"login":"beikeland","id":2701678,"node_id":"MDQ6VXNlcjI3MDE2Nzg=","avatar_url":"https://avatars2.githubusercontent.com/u/2701678?v=4","gravatar_id":"","url":"https://api.github.com/users/beikeland","html_url":"https://github.com/beikeland","followers_url":"https://api.github.com/users/beikeland/followers","following_url":"https://api.github.com/users/beikeland/following{/other_user}","gists_url":"https://api.github.com/users/beikeland/gists{/gist_id}","starred_url":"https://api.github.com/users/beikeland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beikeland/subscriptions","organizations_url":"https://api.github.com/users/beikeland/orgs","repos_url":"https://api.github.com/users/beikeland/repos","events_url":"https://api.github.com/users/beikeland/events{/privacy}","received_events_url":"https://api.github.com/users/beikeland/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-27T11:25:38Z","updated_at":"2018-09-27T15:11:41Z","closed_at":"2018-09-27T15:11:41Z","author_association":"NONE","body":"Having issues decrypting sealed box in browser.\r\n\r\n```\r\n    console.log(\"Start box_seal\");\r\n    var message = \"Hello!\";\r\n    var recipient = sodium.crypto_box_keypair();\r\n    console.log(\"recipient pk: \"+window.btoa(recipient.publicKey));\r\n    console.log(\"recipient sk: \"+window.btoa(recipient.privateKey));\r\n    var ciphertext = sodium.crypto_box_seal(message, recipient.publicKey);\r\n    console.log(\"ciphertext: \"+window.btoa(ciphertext));\r\n    var decrypted=sodium.crypto_box_seal_open(ciphertext, recipient.publicKey, recipient.privateKey);\r\n    console.log(\"decrypted: \"+decrypted);\r\n    console.log(\"End\");\r\n\r\n```\r\n\r\ngives me\r\n```\r\n\r\ntest\r\nsodium.html:22 Start box_seal\r\nsodium.html:30 recipient pk: MjM4LDQwLDI3LDE5MSw3NSwxMDksNTIsOTgsMjI1LDEwMSwxMjcsNDcsMjUzLDE4NywxMjYsMTAxLDE4NiwxNjQsMTIxLDIzNywxNDUsOTMsMTQxLDE5MCwxNDYsMjQ2LDIyLDIzMyw0NCwyMDcsODIsMTE=\r\nsodium.html:31 recipient sk: MTg4LDI1MSwyMzQsNiw1NSwxNTcsNiwxNjMsMTY2LDExOSwxMjEsMTEzLDE0OCw0NSwxODAsMTI2LDIwMywyNiwxNzIsMjIsMTI2LDM1LDI0MiwxMjIsMjQ0LDE4MywxOTksMTA5LDIyOSwxMTksODIsMTk1\r\nsodium.html:34 ciphertext:MTU5LDk3LDIwMiwzNiwxMDUsODMsMTA0LDEwOSw5NywxMTIsMTEzLDExOSwyMzIsMjE2LDg4LDM0LDE1MCwxNjQsMTUzLDkyLDg3LDE5OSwyNDEsMjQ5LDEzNywxMywxNCw3NywxOTYsMTYyLDEzNyw1MSwxMzEsMTEyLDE5NSwxLDEyMSwyNDksNzIsMTYzLDE5NywyNTQsMjAwLDU0LDY3LDg5LDYwLDExNyw4OCwxNjMsNTgsMjE4LDUxLDE5Mg==\r\nsodium.sumo.js:1 Uncaught (in promise) TypeError: invalid ciphertext length\r\n    at E (sodium.sumo.js:1)\r\n    at Object.IA [as crypto_box_seal_open] (sodium.sumo.js:1)\r\n    at onload (sodium.html:36)\r\n    at sodium.sumo.js:1\r\nE @ sodium.sumo.js:1\r\nIA @ sodium.sumo.js:1\r\nonload @ sodium.html:36\r\n(anonymous) @ sodium.sumo.js:1\r\nPromise.then (async)\r\n(anonymous) @ sodium.sumo.js:1\r\n(anonymous) @ sodium.sumo.js:1\r\n```\r\nBut I can send the key, and ciphertext to php and decrypt it just fine. When looking at the console it shows `f(A, I, e, B)` for `sodium.crypto_box_seal_open(` as a autocomplete suggestion. API.md only shows 3 parameters for this function. And I'm a little stuck as to why?\r\n\r\n## crypto_box_seal_open\r\nFunction\r\n\r\n__Parameters:__\r\n* `ciphertext`: Minsized buf\r\n* `publicKey`: Buf (size: libsodium._crypto_box_publickeybytes())\r\n* `privateKey`: Buf (size: libsodium._crypto_box_secretkeybytes())\r\n\r\n__Outputs:__\r\n* `plaintext`: Buf (size: ciphertext_length - libsodium._crypto_box_sealbytes())\r\n\r\n"}}
{"actor":{"display_login":"jedisct1"}}