{"action":"created","issue":{"url":"https://api.github.com/repos/arno01/ocdec/issues/1","labels_url":"https://api.github.com/repos/arno01/ocdec/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/arno01/ocdec/issues/1/comments","events_url":"https://api.github.com/repos/arno01/ocdec/issues/1/events","html_url":"https://github.com/arno01/ocdec/issues/1","id":127389178,"number":1,"title":"Unable to decrypt owncloud data","user":{"login":"5chdn","id":15729797,"avatar_url":"https://avatars.githubusercontent.com/u/15729797?v=3","gravatar_id":"","url":"https://api.github.com/users/5chdn","html_url":"https://github.com/5chdn","followers_url":"https://api.github.com/users/5chdn/followers","following_url":"https://api.github.com/users/5chdn/following{/other_user}","gists_url":"https://api.github.com/users/5chdn/gists{/gist_id}","starred_url":"https://api.github.com/users/5chdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5chdn/subscriptions","organizations_url":"https://api.github.com/users/5chdn/orgs","repos_url":"https://api.github.com/users/5chdn/repos","events_url":"https://api.github.com/users/5chdn/events{/privacy}","received_events_url":"https://api.github.com/users/5chdn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-19T08:19:31Z","updated_at":"2016-01-19T08:59:13Z","closed_at":null,"body":"Hi, I'm unable to decrypt my owncloud data with your script. Here is what I get:\r\n\r\n    0 ✓ root@chaos /usr/share/webapps/owncloud/data $ export USER=user\r\n    0 ✓ root@chaos /usr/share/webapps/owncloud/data $ export userLoginPass='password'\r\n    0 ✓ root@chaos /usr/share/webapps/owncloud/data $ ./ocdec.sh user/files/Directory\\ B/somefile.txt \r\n    unable to load Private Key\r\n    139681757210264:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: ANY PRIVATE KEY\r\n    decryptFile():: The User Private Key is not good. Are you sure your ownCloud User Login password is correct?\r\n    2 ✗ root@chaos /usr/share/webapps/owncloud/data $ ./ocdec.sh user 'password'\r\n    User directory cannot be found! Are you sure you are in ownCloud's data directory?\r\n    1 ✗ root@chaos /usr/share/webapps/owncloud/data $ ./ocdec.sh\r\n    User directory cannot be found! Are you sure you are in ownCloud's data directory?\r\n    1 ✗ root@chaos /usr/share/webapps/owncloud/data $ cd user/\r\n    0 ✓ root@chaos /usr/share/webapps/owncloud/data/user $ ../ocdec.sh\r\n    User directory cannot be found! Are you sure you are in ownCloud's data directory?\r\n\r\nNot sure why but it seems not to accept any user/password combination, I tried 3 different accounts. Do you have an idea why that might be?\r\n\r\nOr do you know any other tool which works without a working owncloud installation?\r\n\r\nCheers"},"comment":{"url":"https://api.github.com/repos/arno01/ocdec/issues/comments/172780282","html_url":"https://github.com/arno01/ocdec/issues/1#issuecomment-172780282","issue_url":"https://api.github.com/repos/arno01/ocdec/issues/1","id":172780282,"user":{"login":"5chdn","id":15729797,"avatar_url":"https://avatars.githubusercontent.com/u/15729797?v=3","gravatar_id":"","url":"https://api.github.com/users/5chdn","html_url":"https://github.com/5chdn","followers_url":"https://api.github.com/users/5chdn/followers","following_url":"https://api.github.com/users/5chdn/following{/other_user}","gists_url":"https://api.github.com/users/5chdn/gists{/gist_id}","starred_url":"https://api.github.com/users/5chdn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/5chdn/subscriptions","organizations_url":"https://api.github.com/users/5chdn/orgs","repos_url":"https://api.github.com/users/5chdn/repos","events_url":"https://api.github.com/users/5chdn/events{/privacy}","received_events_url":"https://api.github.com/users/5chdn/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T08:59:13Z","updated_at":"2016-01-19T08:59:13Z","body":"Here is the `bash -x`, i tried to truncate private info.\r\n\r\n    0 ✓ root@chaos /usr/share/webapps/owncloud/data $ bash -x ./ocdec.sh user/files/Directory\\ B/somefile.txt + USER=user\r\n    ++ echo user/files/Directory B/somefile.txt\r\n    ++ cut -sd / -f 2-\r\n    + FILETD='files/Directory B/somefile.txt'\r\n    + '[' '!' -r user ']'\r\n    + '[' -z 'password' ']'\r\n    + '[' '!' -r 'user/files/Directory B/somefile.txt' ']'\r\n    ++ decryptUserPrivateKey user 'password'\r\n    ++ USER=user\r\n    ++ userLoginPass='password'\r\n    ++ userPrivKeyPath=user/files_encryption/OC_DEFAULT_MODULE/user.privateKey\r\n    ++ '[' '!' -r user/files_encryption/OC_DEFAULT_MODULE/user.privateKey ']'\r\n    +++ cat user/files_encryption/OC_DEFAULT_MODULE/user.privateKey\r\n    ++ encPrivKeyContentsALL=HBEGIN:cipher:AES-256-CFB:keyFormat:hash:HEND/byy+u9JvSuXNix1Isxzl/RhD/0x5MlJqRrkXYygf/VtSia1AfvhgeFBuDfkqSYlfWX9NMWB1rj7phrdNZKmM/rjFQGY8trbjKYYdD544PGIEiqNEwP1HnQ4gXWHC0hvqf0Nfcd1TsR6tG52M/21txjpuEd5odrufZP47KJ+p/PNr4dFfGl/j2vROHBg1xgTh6Cp9pXj+fkL7cHvpvjAP3qdxDyGkLlVrpuaOQZ/qMUYKgmcq8qzGZg3QHX54enzgdi4Jq+sIzLjj99HMWwif495bV24nq4vg5oJISswedYZZkncSfXm2hjo9IoiKQdnZEnkwEsgGPRoFR0iaajNR0wPDzYh07FDcSq8ySxs3bNrF8KU6SBDBou/[...]NVw4MoelUVV+PEW88kcs+dnsclhJdbphlU6PkZQPUY6Ewk3d2W+hXcY19fl8wh2A0mpOFc+kBpquHqstINmx7HiU5JLDjlboXwnCv7WDtiEhLBWGQkV/OzWyV+zzN0=00iv00I59[...]SEtxx\r\n    +++ sed -r 's/^HBEGIN:.+:HEND-*//;s/(00iv00.*)?00iv00.*{16}xx/\\1/' /dev/fd/63\r\n    ++++ echo HBEGIN:cipher:AES-256-CFB:keyFormat:hash:HEND/byy+u9JvSuXNix1Isxzl/RhD/0x5MlJqRrkXYygf/VtSia1AfvhgeFBuDfkqSYlfWX9NMWB1rj7phrdNZKmM/rjFQGY8trbjKYYdD544PGIEiqNEwP1HnQ4gXWHC0hvqf0Nfcd1TsR6tG52M/21txjpuEd5odrufZP47KJ+p/PNr4dFfGl/j2vROHBg1xgTh6Cp9pXj+fkL7cHvpvjAP3qdxDyGkLlVrpuaOQZ/qMUYKgmcq8qzGZg3QHX54enzgdi4Jq+sIzLjj99HMWwif495bV24nq4vg5oJISswedYZZkncSfXm2hjo9IoiKQdnZEnkwEsgGPRoFR0iaajNR0wPDzYh07FDcSq8ySxs3bNrF8KU6SBDBou/[...]NVw4MoelUVV+PEW88kcs+dnsclhJdbphlU6PkZQPUY6Ewk3d2W+hXcY19fl8wh2A0mpOFc+kBpquHqstINmx7HiU5JLDjlboXwnCv7WDtiEhLBWGQkV/OzWyV+zzN0=00iv00I59[...]SEtxx\r\n    ++ encPrivKeyContentsBASE64=/byy+u9JvSuXNix1Isxzl/RhD/0x5MlJqRrkXYygf/VtSia1AfvhgeFBuDfkqSYlfWX9NMWB1rj7phrdNZKmM/rjFQGY8trbjKYYdD544PGIEiqNEwP1HnQ4gXWHC0hvqf0Nfcd1TsR6tG52M/21txjpuEd5odrufZP47KJ+p/PNr4dFfGl/j2vROHBg1xgTh6Cp9pXj+fkL7cHvpvjAP3qdxDyGkLlVrpuaOQZ/qMUYKgmcq8qzGZg3QHX54enzgdi4Jq+sIzLjj99HMWwif495bV24nq4vg5oJISswedYZZkncSfXm2hjo9IoiKQdnZEnkwEsgGPRoFR0iaajNR0wPDzYh07FDcSq8ySxs3bNrF8KU6SBDBou/[...]NVw4MoelUVV+PEW88kcs+dnsclhJdbphlU6PkZQPUY6Ewk3d2W+hXcY19fl8wh2A0mpOFc+kBpquHqstINmx7HiU5JLDjlboXwnCv7WDtiEhLBWGQkV/OzWyV+zzN0=\r\n    +++ sed -r 's/^HBEGIN.*00iv00//;s/xx$//' /dev/fd/63\r\n    ++++ echo HBEGIN:cipher:AES-256-CFB:keyFormat:hash:HEND/byy+u9JvSuXNix1Isxzl/RhD/0x5MlJqRrkXYygf/VtSia1AfvhgeFBuDfkqSYlfWX9NMWB1rj7phrdNZKmM/rjFQGY8trbjKYYdD544PGIEiqNEwP1HnQ4gXWHC0hvqf0Nfcd1TsR6tG52M/21txjpuEd5odrufZP47KJ+p/PNr4dFfGl/j2vROHBg1xgTh6Cp9pXj+fkL7cHvpvjAP3qdxDyGkLlVrpuaOQZ/qMUYKgmcq8qzGZg3QHX54enzgdi4Jq+sIzLjj99HMWwif495bV24nq4vg5oJISswedYZZkncSfXm2hjo9IoiKQdnZEnkwEsgGPRoFR0iaajNR0wPDzYh07FDcSq8ySxs3bNrF8KU6SBDBou/[...]NVw4MoelUVV+PEW88kcs+dnsclhJdbphlU6PkZQPUY6Ewk3d2W+hXcY19fl8wh2A0mpOFc+kBpquHqstINmx7HiU5JLDjlboXwnCv7WDtiEhLBWGQkV/OzWyV+zzN0=00iv00I59[...]SEtxx\r\n    ++ plainPrivKeyIV=I59[...]SEt\r\n    +++ echo -n 'password'\r\n    +++ od -An -tx1\r\n    +++ tr -dc '[:xdigit:]'\r\n    ++ userLoginPassHEX=25565[...]1c2a7\r\n    +++ echo -n I59[...]SEt\r\n    +++ od -An -tx1\r\n    +++ tr -dc '[:xdigit:]'\r\n    ++ plainPrivKeyIVHEX=49353[...]34574\r\n    +++ openssl enc -AES-256-CFB -d -nosalt -base64 -A -K 25565[...]1c2a7 -iv 49353[...]34574 -in /dev/fd/63\r\n    ++++ echo /byy+u9JvSuXNix1Isxzl/RhD/0x5MlJqRrkXYygf/VtSia1AfvhgeFBuDfkqSYlfWX9NMWB1rj7phrdNZKmM/rjFQGY8trbjKYYdD544PGIEiqNEwP1HnQ4gXWHC0hvqf0Nfcd1TsR6tG52M/21txjpuEd5odrufZP47KJ+p/PNr4dFfGl/j2vROHBg1xgTh6Cp9pXj+fkL7cHvpvjAP3qdxDyGkLlVrpuaOQZ/qMUYKgmcq8qzGZg3QHX54enzgdi4Jq+sIzLjj99HMWwif495bV24nq4vg5oJISswedYZZkncSfXm2hjo9IoiKQdnZEnkwEsgGPRoFR0iaajNR0wPDzYh07FDcSq8ySxs3bNrF8KU6SBDBou/[...]NVw4MoelUVV+PEW88kcs+dnsclhJdbphlU6PkZQPUY6Ewk3d2W+hXcY19fl8wh2A0mpOFc+kBpquHqstINmx7HiU5JLDjlboXwnCv7WDtiEhLBWGQkV/OzWyV+zzN0=\r\n    ++ echo '��O\r\n    ��#��F��\u0006�<��\u0017~�*J��\\\u0010s[...]\r\n                                                                                                                     ���$\u0004\\W,��\u0013�\u001D\u001Fo݊��4aD п���澷\u001C�����6�(�'\r\n    + plainUserPrivKey='��O\r\n    ��#��F��\u0006�<��\u0017~�*J��\\\u0010s[...]\r\n                                                                                                                     ���$\u0004\\W,��\u0013�\u001D\u001Fo݊��4aD п���澷\u001C�����6�(�'\r\n    + decryptFile user 'files/Directory B/somefile.txt' '��O\r\n    ��#��F��\u0006�<��\u0017~�*J��\\\u0010s[...]\r\n                                                                                                                     ���$\u0004\\W,��\u0013�\u001D\u001Fo݊��4aD п���澷\u001C�����6�(�'\r\n    + USER=user\r\n    + encFilePath='files/Directory B/somefile.txt'\r\n    + plainUserPrivKey='��O\r\n    ��#��F��\u0006�<��\u0017~�*J��\\\u0010s[...]\r\n                                                                                                                     ���$\u0004\\W,��\u0013�\u001D\u001Fo݊��4aD п���澷\u001C�����6�(�'\r\n    + '[' '!' -r 'user/files/Directory B/somefile.txt' ']'\r\n    + grep -q '^HBEGIN:' 'user/files/Directory B/somefile.txt'\r\n    + userFileShareKeyPath='user/files_encryption/keys/files/Directory B/somefile.txt/OC_DEFAULT_MODULE/user.shareKey'\r\n    + encFileKeyPath='user/files_encryption/keys/files/Directory B/somefile.txt/OC_DEFAULT_MODULE/fileKey'\r\n    ++ od -An -tx1\r\n    ++ tr -dc '[:xdigit:]'\r\n    ++ openssl rsautl -decrypt -inkey /dev/fd/63 -in 'user/files_encryption/keys/files/Directory B/somefile.txt/OC_DEFAULT_MODULE/user.shareKey'\r\n    +++ echo '��O\r\n    ��#��F��\u0006�<��\u0017~�*J��\\\u0010s[...]\r\n                                                                                                                     ���$\u0004\\W,��\u0013�\u001D\u001Fo݊��4aD п���澷\u001C�����6�(�'\r\n    unable to load Private Key\r\n    140461472589464:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:701:Expecting: ANY PRIVATE KEY\r\n    + decUserFileShareKeyHEX=\r\n    + '[' -z '' ']'\r\n    + echo 'decryptFile():: The User Private Key is not good. Are you sure your ownCloud User Login password is correct?'\r\n    decryptFile():: The User Private Key is not good. Are you sure your ownCloud User Login password is correct?\r\n    + return 1\r\n\r\nI don't have owncloud anymore. I removed it some month ago, but it was version 8.1.x if I remember correctly."}}