I have three forms on Kobo Toolbox that I want to download and decrypt using ODK Briefcase.
- Form 1 has 8 submissions,
- Form 2 has 6 submissions,
- Form 3 has 1380 submissions.
I have tried to download and decrypt them using Briefcase 1.15.0 but it can’t even manage to download the forms, saying there is an authentication error.
When I try to download using v1.17.4, it works (with the exact same credentials), but it can’t decrypt.
What I did is write a script using the command-line interface to download the forms using 1.17.4, and decrypt them using 1.15.0.
It works for forms 1 and 2, but not for form 3. The error I get is :
Error: org.opendatakit.briefcase.model.ParsingException: Encrypted file not found
When I look at the instance folders where the data were downloaded, I get for all three forms these files:
The difference is how submission.xml.enc is read for form 3.
Forms 1 and 2 appear like this when opened in a text editor:
Sublime Text 3 tells me it’s UTF-8.
While form 3 is read like this:
5d3f 0f24 3f3f 2679 293f 3f67 cd8d 3f7f c781 435e 3f3f 3f3f 2724 3f43 3f0f 3f3f 543f 3f3a 3f3f 3f26 4f3f 6e6d 6d3f 3f3d 3f3f 2b51 3f65 3e3f 5c3d 3f3d 3f7f 4e3f 4d3f 3f3f 1156 1a37 273f 3f15 023f 3f3f 3f45 573f 3fd7 b324 3f3f 3f58 103f 553b 0d3f 5737 253f 023f 0772 3f69 7b7e 0119 263f 5242 4d3f 3fd5 963f 687d 756c 053f 2d3f 6769 193f 3f3f 3f5e 5859 3f4c 3f4d 13d6 9402 3fce bf24 3f1f 3f0c 3f3f c798
Sublime Text 3 tells me it’s Hexadecimal.
Is there any known reason why it appears encoded in a different way? I guess this is why ODK Briefcase can’t see the encrypted file, but I can’t figure out the reason and the solution of this problem.
Edit: Manually downloading the attachments from the data panel, as a zip acrhive, results in the same submission.xml.enc files that can’t be decrypted.
Edit 2: I have manually sent a new submission on Form 3 with the web interface, and its submission.xml.enc file appears as the ones from form 1 and 2. When I delete all the other submission.xml for the other submissions and only keep the one I just sent, it can be decrypted. If I leave the rest, it tells me it can’t decrypt the files.
The new submission was sent using the Kobo website, while the other 1380 were sent using the Kobo Collect app.
It looks like the website sends properly formatted UTF-8 submission.xml.enc files, while the app sends Hexadecimal-encoded files which can’t be decrypted by Briefcase.