aboutsummaryrefslogtreecommitdiffstats
path: root/docs/development/custom-vectors/rsa-oaep-sha2.rst
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2016-06-02 15:11:03 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2016-06-02 15:11:03 -0700
commit3079299eab48366de44b103125335ece4016dd8e (patch)
tree5afa25a5363b406bcefd5c73a41c31f4788ebf80 /docs/development/custom-vectors/rsa-oaep-sha2.rst
parent7185641941ebf5157f6c5824c4e17a7f854de24c (diff)
downloadcryptography-3079299eab48366de44b103125335ece4016dd8e.tar.gz
cryptography-3079299eab48366de44b103125335ece4016dd8e.tar.bz2
cryptography-3079299eab48366de44b103125335ece4016dd8e.zip
add RSA OAEP SHA2 vectors via custom vector creation (#2829)
* add RSA OAEP SHA2 vectors via custom vector creation * update the docs * retab * remove sha2 oaep support (it will be added again in another PR) * add header to each vector file * Add Java 8 Bouncy Castle based verification of RSA-OAEP SHA-2 test vectors (#4) * Update Java verifier to skip past test vector file header if present (#5) * Update Java verifier to skip past test vector file header if present * Fix tabs vs. space whitespace * generate sha1 oaep permutations as well + verify support in java * address review feedback
Diffstat (limited to 'docs/development/custom-vectors/rsa-oaep-sha2.rst')
-rw-r--r--docs/development/custom-vectors/rsa-oaep-sha2.rst56
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/development/custom-vectors/rsa-oaep-sha2.rst b/docs/development/custom-vectors/rsa-oaep-sha2.rst
new file mode 100644
index 00000000..36f256d7
--- /dev/null
+++ b/docs/development/custom-vectors/rsa-oaep-sha2.rst
@@ -0,0 +1,56 @@
+RSA OAEP SHA2 vector creation
+=============================
+
+This page documents the code that was used to generate the RSA OAEP SHA2
+test vectors as well as code used to verify them against another
+implementation.
+
+
+Creation
+--------
+
+``cryptography`` was modified to allow the use of SHA2 in OAEP encryption. Then
+the following python script was run to generate the vector files.
+
+.. literalinclude:: /development/custom-vectors/rsa-oaep-sha2/generate_rsa_oaep_sha2.py
+
+Download link: :download:`generate_rsa_oaep_sha2.py
+</development/custom-vectors/rsa-oaep-sha2/generate_rsa_oaep_sha2.py>`
+
+
+Verification
+------------
+
+A Java 8 program was written using `Bouncy Castle`_ to load and verify the test
+vectors.
+
+
+.. literalinclude:: /development/custom-vectors/rsa-oaep-sha2/VerifyRSAOAEPSHA2.java
+
+Download link: :download:`VerifyRSAOAEPSHA2.java
+</development/custom-vectors/rsa-oaep-sha2/VerifyRSAOAEPSHA2.java>`
+
+Using the Verifier
+------------------
+
+Download and install the `Java 8 SDK`_. Initial verification was performed
+using ``jdk-8u77-macosx-x64.dmg``.
+
+Download the latest `Bouncy Castle`_ JAR. Initial verification was performed
+using ``bcprov-jdk15on-154.jar``.
+
+Set the ``-classpath`` to include the Bouncy Castle jar and the path to
+``VerifyRSAOAEPSHA2.java`` and compile the program.
+
+.. code-block:: console
+
+ $ javac -classpath ~/Downloads/bcprov-jdk15on-154.jar:./ VerifyRSAOAEPSHA2.java
+
+Finally, run the program with the path to the SHA-2 vectors:
+
+.. code-block:: console
+
+ $ java -classpath ~/Downloads/bcprov-jdk15on-154.jar:./ VerifyRSAOAEPSHA2
+
+.. _`Bouncy Castle`: https://www.bouncycastle.org/
+.. _`Java 8 SDK`: https://www.oracle.com/technetwork/java/javase/downloads/index.html