Home / GitHub Page

Decrypting, again

Sorry to bring that up again: I would really like to be able to decrypt a single md file, including the filename:

  • when doing a manual sync (unison) I would like to identify which files get synced (I want to read the filename)
  • same I would like to check the file with the same name on disk for content before it gets overwritten

I have eg a file: Joplin/613b52ab95a94b5ebd2d17efe53762eb.md

id: 613b52ab95a94b5ebd2d17efe53762eb
parent_id: 93c7afdbc72d4e2590ee9e47ac195295
created_time:
updated_time: 2018-12-22T09:31:44.692Z
is_conflict:
latitude:
longitude:
altitude:
author:
source_url:
is_todo:
todo_due:
todo_completed:
source:
source_application:
application_data:
order:
user_created_time:
user_updated_time:
encryption_cipher_text: JED01000022017e41ef181afc47deb70c3d78a0f3ebab000682{“iv”:“bMmWv2lNohc9uhvYnl6vXw==”,“v”:1,“iter”:1000,“ks”:128,“ts”:64,“mode”:“ocb2”,“adata”:"",“cipher”:“aes”,“salt”:“qzuYGB2pZSk=”,“ct”:"

urkwOg5lSISdI9/QD8F2I3f9lIV8FZm3DiopJZWhPJoawbZlqgLrIMfhw=="}
encryption_applied: 1

I then try a

joplin e2ee --log-level debug decrypt Joplin/613b52ab95a94b5ebd2d17efe53762eb.md
Invalid encryption identifier. Data is not actually encrypted? ID was: Jopli

with the invalid encryption identifier as a result. I assume I misunderstand the e2ee command, but is there a possible option (or another way) to decode filenames + content

Just copy the content in “encryption_cipher_text” in a file called “encrypted.txt” and run the e2ee command on it. This command only decrypts content that is entirely encrypted, while the md file has some decrypted data such as the ID and timestamp.

Perhaps that e2ee command could be improved to recognise this type of md file and decrypt it.

I dont get what I am doing wrong: I used the crypted data from …“adata”:"",“cipher”:“aes”,“salt”:“qzuYGC2pZSk=”,ct:“cfFfskvVEa0FRYM…==”}

cat > encrypted.txt
cfFfskvVEa0FRYM…==
^D

as well as starting from JED01000022017e41ef181afc47deb70c3d78a0f3ebab000682…=="} all with the same error message.

The header for encrypted data is “JED01” (for Joplin Encrypted Data v01) so if it starts with this it should work, or at the very least it should give a different error message.

Or you can post the complete .md file and I’ll tell you what is the encrypted data in there.

Thanks a lot for your patience!
Ok, I tried JED01000022017e41ef181afc47deb70c3d78a0f3ebab000682{ … =="}
same Invalid encryption identifier. Data is not actually encrypted? ID was: encry

where do I get lost?

cat 613b52ab95a94b5ebd2d17efe53762eb.md

id: 613b52ab95a94b5ebd2d17efe53762eb
parent_id: 93c7afdbc72d4e2590ee9e47ac195295
created_time:
updated_time: 2018-12-22T09:31:44.692Z
is_conflict:
latitude:
longitude:
altitude:
author:
source_url:
is_todo:
todo_due:
todo_completed:
source:
source_application:
application_data:
order:
user_created_time:
user_updated_time:
encryption_cipher_text: JED01000022017e41ef181afc47deb70c3d78a0f3ebab000682{“iv”:“bMmWv2lNohc9uhvYnl6vXw==”,“v”:1,“iter”:1000,“ks”:128,“ts”:64,“mode”:“ocb2”,“adata”:"",“cipher”:“aes”,“salt”:“qzuYGB2pZSk=”,“ct”:“cfFfskvVEa0FRYMRhV29/shVQ3SXRpF4T17TRFS2RPXQh8Zu4COmgsK4en4m+Ec01itupQyUDsKv3rJXcBe1f/RTIb+rNXVOH2fyngHGcvCqO4RsGzIg/KoeQGQYpg0sHGZL8D7FQXhl15j4RX+VOiWPIQGIIKGoqlLTfxB97wKrcBjpHN6qilHUSU35cz0U2EPtq28T3chyv7JdEPuFnIv3CI+z7k4rIzcnKkT25HfqHOWd8/KbxvVAIImdrXU6sFWjChf8YKYUIpzdyhdtEJ7lEZWgYvDjwM35OPsNG+7K/dXEOMYNBR80PjVybjvIpc0RSuIToC8Mzc9XJIxp7KRt/7dzomBDG/tRs8OGFzNroytXtZ31CDg2k7xXDUDVVhrzCdHpn7dVR14SBNSV8zsF5jQQTfw/UmCS2PxGLKKjeeiCwvwvrMi5tjGKG54WQlFzzhC9c9rzDO5xSo+70IqHaTCwRmV11ObT01InVFgHGBlcn3Y90CLh9fzRUAq5rKo1pTJI1mfP2VWTxTFKa9Tr+ufZ9ko2eTnnqb4tKlxpqh2GqIDC/qhYN4EkqcXETQpy+1zq7W8f3fvPX6eR7Cu8tqqYjdgrX3Oiu6eNVGTgjwQQs+vehMEVA3pXh5v55n196FN8kGEBy7+8EqNRnZ73xyaW0r+owVTl1LOkgimI72Jy6y9xvQe1oJxagdEYzOm96um7XJHHAF9BL+VzOgVubV6yeaRU1vVuYK/qYYJ0jgeajW3Or7npD0gsXEY64pevHiuv4TFMIRqEMzGKYc3S5fKVOyu9l9tOgGn1gIuK5v9WTqsumjDTqVKwUTU85O7K3uJn1Rbxy30RLc13XKB2C8nJNmfQq+ErEMCGJjJ+DNFxf1IQ2LM6J66H7G3i5JJ9U4n2z1vWYowWxqOyI5XKLrrCoVpfh1DmO4cD97YnpZWHekwFV1N7arUj/JSGnyGcPE06uG+5t4vKhOa68WBoH8g83dhc0ZGZWjO/sffJgF4Q6y4dviIstbo5wfrT0XA4GQ+msaKvghT7Ih6WoAuGJ2jIeRe/PWUeBVtj9X0QCn++HW4PX/6A8+oz/Hm5uRZwAjyfY3sLMqdhEqNm705sq4GSdzyFLmGzGQjTcKzt8lv54E1zp8MffPDTWwam6QHz3wt7/pZNKnu8zPA8qK8b7Lwr/b3RGnYlNix/eml8Or62LS/8THff4SFtDUOeo381SV1fYQGIe8oonCOqA2rVTfmcF7dSi4gQktY+UQj14zO6bG9OalhCDWM6OSHQ1df3AkcopczVb+8gUfAdQi8sIDhcCBg5uEyVRB71dKv3ghGW7JEAP+J24CZXU/Cv9x5J6waEVPhC5B7et8qxGLmHW8Bx7mh+etMiVUJEBA99xMK2J0ZBAsjl/vhloUb9pgaiYDz/svkzIAQ842kqe2kazzmQypeQqXMajKw6T8I20hA5LuKBp5PykHUShurkwOg5lSISdI9/QD8F2I3f9lIV8FZm3DiopJZWhPJoawbZlqgLrIMfhw==”}
encryption_applied: 1

I didn’t see you were using the decrypt command. It should be decrypt-file to decrypt a file or decrypt to decrypt a string.

Ok, I am getting closer: I did not use the decrypt-file command.
Now I do a

joplin e2ee --log-level debug decrypt-file encrypted.txt
result:
Invalid block size:

I tried with another file (crypto data) , same Invalid block size