{"action":"closed","issue":{"url":"https://api.github.com/repos/jeroen/gpg/issues/4","repository_url":"https://api.github.com/repos/jeroen/gpg","labels_url":"https://api.github.com/repos/jeroen/gpg/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/jeroen/gpg/issues/4/comments","events_url":"https://api.github.com/repos/jeroen/gpg/issues/4/events","html_url":"https://github.com/jeroen/gpg/issues/4","id":334209731,"node_id":"MDU6SXNzdWUzMzQyMDk3MzE=","number":4,"title":"Error encrypting zipped tarballs","user":{"login":"adrowe1","id":4489859,"node_id":"MDQ6VXNlcjQ0ODk4NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/4489859?v=4","gravatar_id":"","url":"https://api.github.com/users/adrowe1","html_url":"https://github.com/adrowe1","followers_url":"https://api.github.com/users/adrowe1/followers","following_url":"https://api.github.com/users/adrowe1/following{/other_user}","gists_url":"https://api.github.com/users/adrowe1/gists{/gist_id}","starred_url":"https://api.github.com/users/adrowe1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrowe1/subscriptions","organizations_url":"https://api.github.com/users/adrowe1/orgs","repos_url":"https://api.github.com/users/adrowe1/repos","events_url":"https://api.github.com/users/adrowe1/events{/privacy}","received_events_url":"https://api.github.com/users/adrowe1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-20T19:03:01Z","updated_at":"2018-12-29T12:59:06Z","closed_at":"2018-12-29T12:59:06Z","author_association":"NONE","body":"For reasons beyond my control, I'm trying to preserve directory structures while sending many asymmetrically encrypted datasets to an external API from R on Windows.\r\n\r\nI figured the best solution here was to tar/zip parent directories, encrypt using `gpg::gpg_encrypt()`, then POST to the API.\r\n\r\nA near-complete reprex is shown here - needing only a public key fingerprint to be usable.\r\n```r\r\nlibrary(gpg)\r\n# make a demo directory to compress and encrypt.\r\ndir.create(\"test_dir\")\r\nwriteLines(paste0(rep(\"aaa\\n\", 10), collapse=\"\"), \"test_dir/test1.txt\")\r\nwriteLines(paste0(rep(\"bbb\\n\", 20), collapse=\"\"), \"test_dir/test2.txt\")\r\ntar(\"test_dir.tar.gz\", \"test_dir\", compression = \"gzip\")\r\n\r\n# encrypt file\r\npublicKeyFingerprint <- # Choose a fingerprint you own so you can test decryption\r\nencrypted <- gpg_encrypt(\"test_dir.tar.gz\", publicKeyFingerprint)\r\nwriteLines(encrypted, \"test_dir.tar.gz.gpg\")\r\n\r\n# try to decrypt\r\ngpg_decrypt(\"test_dir.tar.gz.gpg\")\r\n```\r\n\r\nFor some reason there is an issue with the encrypted output, meaning it cannot be decrypted, and I get the following error message.  \r\n`Error in gpg_decrypt(\"test_dir.tar.gz.gpg\") : \r\n  embedded nul in string:   '\\037\\x8b\\b\\0\\0\\0\\0\\0\\0\\003\\xed\\xd4 ... \\xe6?\\xbc\\0015x)\\r\\0\\f\\0\\0'`  \r\n\r\nI also notice that the encrypted data is always far smaller than should be expected for larger files.  \r\n\r\nIs there something obvious I'm doing wrong?  \r\n\r\nI tried a similar strategy replacing asymmetrical encryption by `gpg::gpg_encrypt()` with symmetrical using `crypt::encrypt()` and this worked fine, but it's nowhere near as elegant a solution as `gpg_encrypt()` could be if it works.\r\n\r\nDo you have any suggestions to solve this issue?\r\n\r\nThanks a lot!\r\n\r\n_Error occurs on R v3.5.0 on OSX, with gpg v0.5 from CRAN._"}}
{"actor":{"display_login":"jeroen"}}