Package org.refcodes.security.alt.chaos
”… Betrachten wir die “Nachfolger-“ oder “Poincaré” Funktion N(x) = A*x*(1-x). Durch diese Vorschrift wird eine interessante Folge beschrieben.”
The Poincaré function N(x) = Ax(1-x) has been chosen for this chaos-based encryption approach. Whether this approach fulfills todays requirements for secure symmetric encryption, i cannot tell - I coded the algorithm using Atari Basic in the late 80s, the article describing the algorithm most probably is even older ...
(the refcodes-security-ext-chaos
artifact provides the vanilla
plain refcodes-security-alt-chaos
algorithm as a JCE (Java
cryptographic extension).
Actually I am very interested in a discussion on the quality of the produced randomness; an approach would be measuring the randomness as being described by the article on Testing Random Number Generators published by the Dr Dobb’s magazine.
How do I get set up?
To get up and running, include the following dependency (without the three dots “…”) in your pom.xml:<dependencies> ... <dependency> <artifactId>refcodes-security-alt-chaos</artifactId> <groupId>org.refcodes</groupId> <version>x.y.z</version> </dependency> ... </dependencies>(please refer to Maven Central at "http://search.maven.org/#search|ga|1|g%3A%22org.refcodes%22" for the most current version)
The artifact is hosted directly at Maven Central. Jump straight to the source codes at Bitbucket. Read the artifact’s javadoc at javadoc.io.
A plain vanilla example
First you instantiate a ChaosTextEncrypterImpl with the given secret parameters:ChaosTextEncrypter theEncrypter = new ChaosTextEncrypterImpl( x0, a, s );Your
x0
parameter must be in the range ( 0 <= x0 <= 1 ),
your a
parameter must be in the range ( 3.57 <= a <= 4 )
and finally your s
parameter must be smaller or equals to the
biggest Long value: ( s <= Long.MAX_VALUE ).
Encryption is straight forward, decryption is very similar, so below find the complete example:
double x0 = 0.67; double a = 3.61; int s = 12536; ChaosTextEncrypter theEncrypter = new ChaosTextEncrypterImpl( x0, a, s ); String theEncrypted = theEncrypter.toEncrypted( theMessage ); ChaosTextDecrypter theDecrypter = new ChaosTextDecrypterImpl( x0, a, s ); String theDecrypted = theDecrypter.toDecrypted( theEncrypted );See also:
- http://www.refcodes.org/refcodes/refcodes-security
- http://www.refcodes.org/blog/chaos-based_encryption
-
Interface Summary Interface Description ChaosDecrypter TheChaosDecrypter
will use byte arrays as input and output types.ChaosEncrypter TheChaosEncrypter
will use byte arrays as input and output types.ChaosKey The key holding the parameters for the implemented chaos function.ChaosTextDecrypter TheChaosTextDecrypter
will useString
as input and output type.ChaosTextEncrypter TheChaosTextEncrypter
will useString
as input and output type. -
Class Summary Class Description ChaosDecrypterImpl The Class ChaosDecrypterImpl.ChaosEncrypterImpl The Class ChaosEncrypterImpl.ChaosKeyImpl Thanks Christian Pontesegger for the very good example on "Writing your own JCA extensions - a full cipher" at: "http://codeandme.blogspot.de/2013/07/writing-your-own-jca-extensions-full.html" and for the very good example on "Writing your own JCA extensions - a simple digest " at: "http://codeandme.blogspot.de/2013/06/writing-your-own-jca-extensions-simple.html"ChaosTextDecrypterImpl The Class ChaosTextDecrypterImpl.ChaosTextEncrypterImpl The Class ChaosTextEncrypterImpl.