glusk / caesar Goto Github PK
View Code? Open in Web Editor NEWAn object-oriented approach to cryptography in Java.
License: MIT License
An object-oriented approach to cryptography in Java.
License: MIT License
This fails:
@Test
public void parsesANegativeByteValue() {
assertArrayEquals(
new byte[] { (byte) 0b10000000 },
new Hex("80").asArray()
);
}
Lets add this feature to the library!
MessageDigest
objectH(H(b1), b2, b3)
A release version should not be committed. The flow should be as follows:
release
branch; bump version to a new release tag and push itmaster
branch; bump version to a new snapshot version and push the changeThere should be a "dry run" option that doesn't push anything to the remote repository.
Refer to this SO Question!
It contains only one abstract method.
And WrappedBytes
class is not really needed. Wherever there is:
new WrappedBytes(...)
in the code base, one can replace it with:
() -> ...
This line
returns a new object with non-updated values of i and j.
No test cases check for chained update()
calls so this was not detected.
Test coverage should be 100% given the currently (version 0.1.0
) still relatively small codebase size.
Update push condition to:
if [ "$success"] && [ "$dryRun" = false ]
Enable Checkstyle checks for tests but skip Javadoc checks.
Reasons against enforcing Javadoc comments in tests:
/** The test for class Foo. */
)The Java 9 modules source path is not properly detected by the coveralls maven plugin.
Coveralls plugin further complains:
Execution default-cli of goal org.eluder.coveralls:coveralls-maven-plugin:4.3.0:report failed: A required class was missing while executing org.eluder.coveralls:coveralls-maven-plugin:4.3.0:report: javax/xml/bind/DatatypeConverter
A workaround was proposed here.
Javadocs feel vague and imprecise.
After closing #25, this dependency is no longer needed!
After implementing #25, the following API changes should be made:
DigestArgument(String, int)
DigestArgument(byte[])
DigestArgument
should be renamed to PlainText
and moved to package com.github.glusk.caesar
BinaryString
Setup Travis to deploy the project to Maven Central every time a new git tag is pushed.
Resources:
At the moment, we're wired to an external dependency jakarta.xml.bind:jakarta.xml.bind-api
just so that we can use DatatypeConverter
. This dependency could be removed.
Java 8 introduced Base64
class and the hex encoding/decoding looks easy enough to implement.
The library currently only parses Base64 and Base16 strings. We should add default
methods to Bytes
that would encode byte sequences to Base64 and Base16 strings.
Apparently, Travis now only supports free builds for OSS on specific architectures. Add this to .travis.yml
:
os: linux
arch:
- arm64
- ppc64le
- s390x
Also, fix Travis build status badge.
-B
(batch mode) flag to all Maven commandsCompare Bytes
instead of arrays.
We want to specify the contract of some of the Object
's methods at the Bytes
interface level. As these can't be implemented as default
methods, we can use a pattern similar to the one used in java.util
(List
and AbstractList
).
Add an abstract class AbstractBytes
that extends implements the Bytes
interface.
Remove the @FunctionalInterface
annotation in Bytes
interface definition since the use of Bytes
in a lambda expression is discouraged. Doing so breaks its equals()
contract, for example.
AbstractBytes
should implement equals()
, hashCode()
and toString()
(YAGNI, at the moment).
Classes that used to implement Bytes
should now extend AbstractBytes
.
Add an introduction paragraph with maven dependency library usage example.
Document the release process - how to bump the version and triger a release/deployment.
Some code snippets seem to lack focus. The accompanying text could be made shorter.
Added the repo to codacy:
https://www.codacy.com/manual/Glusk/caesar
Show the core concept of wrapping a MessageDigest
instance into an ImmutableMessageDigestObject
.
Let's add an RC4 Cipher implementation!
Qucik draft:
interface ImmutableCipher {
ImmutableCipher init(Bytes key);
ImmutableCipher update(Bytes message);
Bytes doFinal();
}
class RC4 implements ImmutableCipher {
public RC4() {}
private RC4(/* Internal state: S, i, j */) {}
}
Lets add a simple xor
function that operates on Bytes
.
Implement HMAC as specified in RFC 2104.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.