Package org.refcodes.security.alt.chaos

In the article "Chaos-based encryption" (see "http://www.refcodes.org/blog/chaos-based_encryption/") I published a text I received in the late 1980s in Harare (Zimbabwe) by the mathematician Sönke Rehder; there a chaos-based symmetric cryptographic algorithm is being described:

”… 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 ChaosTextEncrypter with the given secret parameters:
 ChaosTextEncrypter theEncrypter = new ChaosTextEncrypter( 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 ChaosTextEncrypter( x0, a, s );
 String theEncrypted = theEncrypter.toEncrypted( theMessage );
 ChaosTextDecrypter theDecrypter = new ChaosTextDecrypter( 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