Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added encryption sub-spec that describes how to encrypt a record, clo… #208

Merged
merged 5 commits into from Oct 4, 2018

Conversation

MartijnR
Copy link
Contributor

@MartijnR MartijnR commented Oct 4, 2018

…ses #186

Still need to tweak the navigation menus with a back to main spec and encryption spec links, but maybe that can be done in another PR.

Copy link
Member

@lognaturel lognaturel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very thorough and nicely organized. Would be good to get another check from @ggalmazor.

<encryptedXmlFile>submission.xml.enc</encryptedXmlFile>
<media>
<file>myimage.jpg.enc</file>
<file>myaudio.mp3</file>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would have a .enc extension, right?

Do we want to show this compact syntax even though Aggregate seems to botch it? I think it's ok because there should be an impending fix (getodk/aggregate#319) but wanted to bring it up.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd +1 to have the syntax Collect produces, which is the same one Aggregate generates:

<media>
  <file>blah.jpg.enc</file>
</media>
<media>
  <file>bleh.jpg.enc</file>
</media>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can do. I forgot to highlight this to you. My thought was, once both syntaxes are supported in Aggregate, to document only the nice one (and phase out the old one from Collect and Enketo in a few years). However, no big deal. We could update it later.


The AES encryption is a random 256 bit key generated by the client for each record. The submission manifest contains a base64-encoded string of this key.

After encrypting all files belonging to the record and generating the submission manifest, it is thrown away.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "it" that is thrown away is the key, right? I might say "the raw key" or something because my first couple of readings suggested the manifest was thrown away which doesn't make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! Thanks. Will change!


### Content Encryption

The XML file and uploaded files are encrypted with the equivalent of the **AES/CFB/PKCS5Padding** algorithm as used in Java 9 with a [specified initialization vector algorithm](#initialization-vector).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Java 9 here? We are using Java 8

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I had no idea. Thanks. Will change to 8!


### Key Encryption.

The AES encryption key is encrypted using the equivalent of the **RSA/NONE/OAEPWithSHA256AndMGF1Padding** in Java 9 using the RSA public key that is part of the [XForm definition](/#encryption). The result is base64-encoded.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More Java 9 here

@lognaturel lognaturel merged commit 9d1c580 into gh-pages Oct 4, 2018
@MartijnR MartijnR deleted the feature/encryption-spec-186 branch October 4, 2018 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants