August 2017
« Nov    

Recent Posts

XDiceLock for Apple Mac OS X, ARC4_Discarding class (ARC 4 Discarding stream cipher algorithm) verified with IETF RFC 6229, 64 bit key, set 1 and PhysicalCryptoRandomStream class (memory pages kept in RAM, not swapped to file)

XDiceLock for Apple Mac OS X is the cryptographic architecture that ensures that ciphertext it’s not just encrypted but also randomized.

DiceLock cipher architecture presents two main configurations:
Dicelock Digested, and
Dicelock Indexed.

DiceLock encryption architecture improves symmetric ciphers like block cipher as Advanced Encryption Standard, Camellia, Serpent, Twofish (128, 192 and 256 bit key lengths) with different block cipher operation modes (like CBC, CFB, OFB and XTS) and stream ciphers as HC 128, HC 256, Rabbit, Salsa 20/20, Sosemanuk and others.

DiceLock (both configurations) makes use of the following random number tests: Frequency Test, Block Frequency Test, Cumulative Sum Forward Test, Cumulative Sum Reverse Test, Runs Test, Longest Run Of Ones Test, Rank Test, Universal Test, Approximate Entropy Test, Serial Test and Discrete Fourier Transform Test.

Additionally DiceLock Digested configuration makes use currently of following hash digest algorithms: Sha 1, Sha 224, Sha 256, Sha 384, Sha 512, Ripemd 128, Ripemd 160, Ripemd 256, Ripemd 320, Md2, Md4 and Md5.

Previous version XDiceLock for Apple Mac OS X incorporated XTS-AES (XEX-based tweaked-codebook mode with ciphertext stealing XTS block cipher operation mode algorithm) for Advanced Encryption Algorithm (AES) for 128 and 256 bit symmetric keys.

New version XDiceLock for Apple Mac OS X has made significant improvements:
- added block encryption ciphers like Camellia, Serpent and Twofish with all accepted key lengths of 128, 192 and 256 bits,
- added stream ciphers like Rabbit, Salsa 20/20 with 128 and 256 bit key lengths, and general Sosemanuk, as well as Sosemanuk with 128 and 256 bit key lengths,
- added old hash algorithms like Message Digest 2, Message Digest 4 and Message Digest 5,
- modified DiceLockIndexed and DiceLockDigested classes to be used with encryption ciphers that does not make use of initialization vector (IV),
- created DiceLockIVDigested and DiceLockIVIndexed classes to be used with encryption ciphers that makes use of initialization vector (IV),
- extended DiceLockXTSDigested and DiceLockXTSIndexed classes to be use with newly added Camellia, Serpent and Twofish block ciphers and all three key lengths (128, 192 and 256 bit key lengths),
- added old encryption ciphers like DEA (Data Encryption Algorithm), TDEA (Triple Data Encryption Algorithm), and ARC4 (alleged RC4) for compatibillity reasons.

As the new version XDiceLock for Apple Mac OS X is developed, all individual components must be tested and verified, and in this article we verify ARC 4 Discarding class (computing ARC 4 Discarding stream cipher algorithm).

At the bottom of the post you can find C++ source code being used to perform this test.

Verified XDiceLock for Apple Mac OS X

Verification components:

– Stream encryption cipher algorithm: ARC4_Discarding class
– Discarded initial bytes: 512
– Test set: IETF RFC 6229, 64 bit key, set 1
– Bit stream memory management: PhysicalCryptoRandomStream class (memory pages kept in RAM, not swapped to file)

Memory characteristic used in this test:

PhysicalCryptoRandomStream class makes use of mlock that uses physical nonpaged memory, preventing that memory from being paged to the swap area, so memory is not swapped to hard disk. The pages are guaranteed to stay in RAM until later PhysicalCryptoRansomStream object is deleted.
In order to use PhysicalCryptoRandomStream class, the process must be privileged (CAP_IPC_LOCK) in order to lock memory, and since Linux 2.6.9, no limits are placed on the amount of memory that a privileged process can lock and the RLIMIT_MEMLOCK soft resource defines the limit on how much memory an unprivileged process may lock.


Input plaintext: 4112 zero bytes
Key: 0102030405060708

Once computed we’ve got the following results:

Byte offset: 0
Expected 163b319923a6bdb4527c626126703c0f
Computed 163b319923a6bdb4527c626126703c0f
Result: OK
Byte offset: 240
Expected 49d6c8af0f97144a87df21d91472f966
Computed 49d6c8af0f97144a87df21d91472f966
Result: OK
Byte offset: 256
Expected 44173a103b6616c5d5ad1cee40c863d0
Computed 44173a103b6616c5d5ad1cee40c863d0
Result: OK
Byte offset: 496
Expected 273c9c4b27f322e4e716ef53a47de7a4
Computed 273c9c4b27f322e4e716ef53a47de7a4
Result: OK
Byte offset: 512
Expected c6d0e7b226259fa9023490b26167ad1d
Computed c6d0e7b226259fa9023490b26167ad1d
Result: OK
Byte offset: 1008
Expected 1fe8986713f07c3d9ae1c163ff8cf9d3
Computed 1fe8986713f07c3d9ae1c163ff8cf9d3
Result: OK
Byte offset: 1024
Expected 8369e1a965610be887fbd0c79162aafb
Computed 8369e1a965610be887fbd0c79162aafb
Result: OK
Byte offset: 1520
Expected 0a0127abb44484b9fbef5abcae1b579f
Computed 0a0127abb44484b9fbef5abcae1b579f
Result: OK
Byte offset: 1536
Expected c2cdadc6402e8ee866e1f37bdb47e42c
Computed c2cdadc6402e8ee866e1f37bdb47e42c
Result: OK
Byte offset: 2544
Expected 26b51ea37df8e1d6f76fc3b66a7429b3
Computed 26b51ea37df8e1d6f76fc3b66a7429b3
Result: OK
Byte offset: 2560
Expected bc7683205d4f443dc1f29dda3315c87b
Computed bc7683205d4f443dc1f29dda3315c87b
Result: OK
Byte offset: 3568
Expected d5fa5a3469d29aaaf83d23589db8c85b
Computed d5fa5a3469d29aaaf83d23589db8c85b
Result: OK
Byte offset: 3584
Expected 3fb46e2c8f0f068edce8cdcd7dfc5862
Computed 3fb46e2c8f0f068edce8cdcd7dfc5862
Result: OK
DECIPHERING Checking deciphered text with input plaintext: OK

XDiceLock for Apple Mac OS X C++ source code used in this test:

XDiceLock for Apple Mac OS X


So, DiceLock cipher test and analysis can go on …

DiceLock is a trademark or registered trademark of his owner where applies. DiceLock research is the research to implement Self-corrector randomisation-encryption and method, european patent EP1182777 granted 08/21/2003 and US patent US7508945 granted 03/24/2009.

Leave a Reply