Mixed unary cryptography
View Patent ↗A stream of plaintext is marked per its more sensitive parts. These marked parts are being encrypted via mathematically secure ciphers for which the ciphertext may be much larger than the plaintext. This invention creates a mix of size-preserving encryption for the not so sensitive parts of the plaintext, and size-enlarging encryption for the marked parts, thereby security is served without the inconvenience of a very long ciphertext.
1. A method comprising:
receiving, by a computing device, a plaintext message M;
selecting, by the computing device, n segments (P 1 , P 2 , P 3 . . . P n ) from the plaintext message M,
wherein n is a positive integer greater than or equal to two, and
wherein the selected n segments (P 1 , P 2 , P 3 . . . P n ) are a subset of the plaintext message M;
removing, by the computing device, each of the selected n segments (P 1 , P 2 , P 3 . . . P n ) from the plaintext message M; and
concatenating, by the computing device, remaining sections of plaintext message to a contiguous left-over message M i ;
for each of the selected n segments (P 1 , P 2 , P 3 . . . P n ):
identifying, by the computing device, a bit position value t i , i=1, 2, . . . n,
wherein the bit position value t i denotes a bit position for each of the selected n segments (P 1 , P 2 , P 3 . . . P n ) relative to the plaintext message M;
generating, by the computing device, a concatenated segment P* i , i=1, 2, . . . n, for each of the selected n segments (P 1 , P 2 , P 3 . . . P n ),
wherein each of the concatenated segments P* i , i=1, 2, . . . n, is generated from concatenating a corresponding segment P i , i=1, 2, . . . n, with a first header with h header bits corresponding to the bit position value t i and a first trailer bits, according to the formula
P* i =[ h bits indicating t i ]∥ P i ∥[trailer bits],
wherein the first trailer bits are set to 1 for i=1, 2, . . . (n−1), and 0 for i=n;
concatenating, by the computing device, a second header bits in the form of “1000 . . . 1” to each of the concatenated segments P* i , i=1, 2, . . . n, the second header bits comprise of an arbitrary number of numerical zeros between numerical ones;
concatenating, by the computing device, a second trailer bits in the form of “0111 . . . 0” to each of the concatenated segments P* i , i=1, 2, . . . n, the second trailer bits comprise an arbitrary number of numerical ones between numerical zeros, so as to update the each of the concatenated segments P* i , i=1, 2, . . . n;
encrypting, by the computing device, each of the updated concatenated segments P* i , i=1, 2, . . . n, using an augmented-ciphertext cipher A with an augmented cipher key K a , and generating a corresponding ciphertext C i , i=1, 2, . . . n, according to the formula
C i =α( P* i ,K a ),
where α denotes encryption with the augmented-ciphertext cipher A,
wherein each of the ciphertexts C i , i=1, 2, . . . n, has same bit size;
for the contiguous left-over message M 1 :
encrypting, by the computing device, the contiguous left-over message M 1 using a base cipher B with a base cipher key K b , according to the formula
C 1 =β( M 1 ,K b ),
where β denotes encryption with the base cipher B,
wherein the base cipher B uses different encryption algorithm and encryption key from the augmented-ciphertext cipher A;
generating, by the computing device, a mixed ciphertext C m by concatenating the ciphertext C i , i=1, 2, . . . n, and C 1 according to the formula C m =C 1 ∥C 2 ∥ . . . ∥C n ∥C 1 ; and
transmitting, by the computing device, the mixed ciphertext C m to an intended recipient.