mbuet2ner / JEasyCrypto

A project for educational purposes for the course "Open Source Software Development" at the University of Oulu
GNU General Public License v3.0
2 stars 23 forks source link

Add unit tests #21

Open Ohiekkar opened 4 years ago

Ohiekkar commented 4 years ago

We should definitely add some unit tests. How else can we be sure that the different encrypting methods produce correct results?

mbuet2ner commented 4 years ago

I agree. This would also allow us to leverage continuous integration e.g. Travis CI. Would be happy if someone would add this.

pottumuusi commented 4 years ago

Have never written test code for crypto implementations, but maybe these provide some inspiration.

Android crypto tests

https://android.googlesource.com/platform/external/bouncycastle/+/397d32894b89b506dc318e0f83446187c9b76ebe/bcprov/src/main/java/org/bouncycastle/crypto/test

Project Wycheproof tests crypto libraries against known attacks.

https://github.com/google/wycheproof https://www.schneier.com/blog/archives/2016/12/google_releases.html

There was rot13 mentioned in sources. Maybe it is tested somewhat like encoding is? https://github.com/openssl/openssl/blob/master/test/asn1_encode_test.c