April 2014
« Oct    

Recent Posts

XDiceLock for Apple Mac OS X, CBC_Mode class (Cipher-block chaining CBC block cipher operation mode algorithm), with ANSI_X_923 class crypto padding algorithm, verified with TDEA, SubstitutionTable test set 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 Cipher-block chaining CBC class (computing Cipher-block chaining CBC block 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:

– Block cipher operation mode encryption algorithm: CBC_Mode class
– CBC crypto padding algorithm: ANSI_X_923 class
– Block cipher encryption algorithm: TDEA class
– Test set : SubstitutionTable
– 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.


CBC_Mode class block cipher operation mode is executed with ANSI_X_923 class crypto padding algorithm. Encrypted text length is set to 128 and it does match expected ciphertext first 64 bits, remaining 64 bits corresponding to crypto pad data are shown in italic.

Once computed we’ve got the following results:

Substution table, # 1

Input plaintext: 01a1d6d039776742
Key: 7ca110454a1a6e577ca110454a1a6e577ca110454a1a6e57
IV: 0000000000000000
Expected ciphertext: 690f5b0d9a26939b
Computed ciphertext: 690f5b0d9a26939b0647ce7b374a67dd OK
DECIPHERING Deciphered text: 01a1d6d039776742 OK


Substution table, # 2

Input plaintext: 5cd54ca83def57da
Key: 0131d9619dc1376e0131d9619dc1376e0131d9619dc1376e
IV: 0000000000000000
Expected ciphertext: 7a389d10354bd271
Computed ciphertext: 7a389d10354bd27115be7d0a8cd2511f OK
DECIPHERING Deciphered text: 5cd54ca83def57da OK


Substution table, # 3

Input plaintext: 0248d43806f67172
Key: 07a1133e4a0b268607a1133e4a0b268607a1133e4a0b2686
IV: 0000000000000000
Expected ciphertext: 868ebb51cab4599a
Computed ciphertext: 868ebb51cab4599a584bf3b59c4c08ee OK
DECIPHERING Deciphered text: 0248d43806f67172 OK


Substution table, # 4

Input plaintext: 51454b582ddf440a
Key: 3849674c2602319e3849674c2602319e3849674c2602319e
IV: 0000000000000000
Expected ciphertext: 7178876e01f19b2a
Computed ciphertext: 7178876e01f19b2aaaaf948e6a25c05d OK
DECIPHERING Deciphered text: 51454b582ddf440a OK


Substution table, # 5

Input plaintext: 42fd443059577fa2
Key: 04b915ba43feb5b604b915ba43feb5b604b915ba43feb5b6
IV: 0000000000000000
Expected ciphertext: af37fb421f8c4095
Computed ciphertext: af37fb421f8c4095a0f6e6a6e23fef32 OK
DECIPHERING Deciphered text: 42fd443059577fa2 OK


Substution table, # 6

Input plaintext: 059b5e0851cf143a
Key: 0113b970fd34f2ce0113b970fd34f2ce0113b970fd34f2ce
IV: 0000000000000000
Expected ciphertext: 86a560f10ec6d85b
Computed ciphertext: 86a560f10ec6d85b3af4977812613fc7 OK
DECIPHERING Deciphered text: 059b5e0851cf143a OK


Substution table, # 7

Input plaintext: 0756d8e0774761d2
Key: 0170f175468fb5e60170f175468fb5e60170f175468fb5e6
IV: 0000000000000000
Expected ciphertext: 0cd3da020021dc09
Computed ciphertext: 0cd3da020021dc09d5999a1c05a12d21 OK
DECIPHERING Deciphered text: 0756d8e0774761d2 OK


Substution table, # 8

Input plaintext: 762514b829bf486a
Key: 43297fad38e373fe43297fad38e373fe43297fad38e373fe
IV: 0000000000000000
Expected ciphertext: ea676b2cb7db2b7a
Computed ciphertext: ea676b2cb7db2b7a0ca610476774c5bf OK
DECIPHERING Deciphered text: 762514b829bf486a OK


Substution table, # 9

Input plaintext: 3bdd119049372802
Key: 07a7137045da2a1607a7137045da2a1607a7137045da2a16
IV: 0000000000000000
Expected ciphertext: dfd64a815caf1a0f
Computed ciphertext: dfd64a815caf1a0f69a1afe193d388e6 OK
DECIPHERING Deciphered text: 3bdd119049372802 OK


Substution table, # 10

Input plaintext: 26955f6835af609a
Key: 04689104c2fd3b2f04689104c2fd3b2f04689104c2fd3b2f
IV: 0000000000000000
Expected ciphertext: 5c513c9c4886c088
Computed ciphertext: 5c513c9c4886c088642de250ea22e149 OK
DECIPHERING Deciphered text: 26955f6835af609a OK


Substution table, # 11

Input plaintext: 164d5e404f275232
Key: 37d06bb516cb754637d06bb516cb754637d06bb516cb7546
IV: 0000000000000000
Expected ciphertext: 0a2aeeae3ff4ab77
Computed ciphertext: 0a2aeeae3ff4ab77873ac7321cece69d OK
DECIPHERING Deciphered text: 164d5e404f275232 OK


Substution table, # 12

Input plaintext: 6b056e18759f5cca
Key: 1f08260d1ac2465e1f08260d1ac2465e1f08260d1ac2465e
IV: 0000000000000000
Expected ciphertext: ef1bf03e5dfa575a
Computed ciphertext: ef1bf03e5dfa575a5efa0e68afea2f51 OK
DECIPHERING Deciphered text: 6b056e18759f5cca OK


Substution table, # 13

Input plaintext: 004bd6ef09176062
Key: 584023641aba6176584023641aba6176584023641aba6176
IV: 0000000000000000
Expected ciphertext: 88bf0db6d70dee56
Computed ciphertext: 88bf0db6d70dee56f98ab2e0333179d6 OK
DECIPHERING Deciphered text: 004bd6ef09176062 OK


Substution table, # 14

Input plaintext: 480d39006ee762f2
Key: 025816164629b007025816164629b007025816164629b007
IV: 0000000000000000
Expected ciphertext: a1f9915541020b56
Computed ciphertext: a1f9915541020b565d253d83a243acb6 OK
DECIPHERING Deciphered text: 480d39006ee762f2 OK


Substution table, # 15

Input plaintext: 437540c8698f3cfa
Key: 49793ebc79b3258f49793ebc79b3258f49793ebc79b3258f
IV: 0000000000000000
Expected ciphertext: 6fbf1cafcffd0556
Computed ciphertext: 6fbf1cafcffd05569e9734ec6b2ebd57 OK
DECIPHERING Deciphered text: 437540c8698f3cfa OK


Substution table, # 16

Input plaintext: 072d43a077075292
Key: 4fb05e1515ab73a74fb05e1515ab73a74fb05e1515ab73a7
IV: 0000000000000000
Expected ciphertext: 2f22e49bab7ca1ac
Computed ciphertext: 2f22e49bab7ca1ac1104789d0b6201c6 OK
DECIPHERING Deciphered text: 072d43a077075292 OK


Substution table, # 17

Input plaintext: 02fe55778117f12a
Key: 49e95d6d4ca229bf49e95d6d4ca229bf49e95d6d4ca229bf
IV: 0000000000000000
Expected ciphertext: 5a6b612cc26cce4a
Computed ciphertext: 5a6b612cc26cce4ac59c7a34d0c82fec OK
DECIPHERING Deciphered text: 02fe55778117f12a OK


Substution table, # 18

Input plaintext: 1d9d5c5018f728c2
Key: 018310dc409b26d6018310dc409b26d6018310dc409b26d6
IV: 0000000000000000
Expected ciphertext: 5f4c038ed12b2e41
Computed ciphertext: 5f4c038ed12b2e41827c824e455a06c5 OK
DECIPHERING Deciphered text: 1d9d5c5018f728c2 OK


Substution table, # 19

Input plaintext: 305532286d6f295a
Key: 1c587f1c13924fef1c587f1c13924fef1c587f1c13924fef
IV: 0000000000000000
Expected ciphertext: 63fac0d034d9f793
Computed ciphertext: 63fac0d034d9f7933a539f3aaa3f0fa9 OK
DECIPHERING Deciphered text: 305532286d6f295a 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