A method to encrypt data, wherein in a system implemented in computational form or in digital integrated circuits, and wherein a numeric set is used to cipher a base message making its content unintelligible, the method comprising the following stages:
- (a) defining a base message with a certain type of characters, wherein from the total number of characters in the base message, one or more [A1] matrices are built so that the total number of characters in the base message is contained in the [A1] matrices;
- (b) defining a numeric set formed by consecutive numbers from 1 to the size of the matrix, which is equal to the product of the number of rows and the number of columns, combinatorially distributed in a matrix [B1] of the same size of matrix [A1];
- (c) establishing a first series of four successive rearranging operations that are to be applied to matrix [A1] to transform the base message into an intermediate message [A2], wherein
- the first the series of rearranging operations comprise:
- transposing rows;
- transposing columns;
- rotating concentric parallelograms;
- and reflecting the matrix [A1];
- and
- the series is codified with the first series of rearranging operations to be applied forming the keyword CK1;
- (d) establishing a second series of four successive rearranging operations that are to be applied to matrix [B1] to transform the numeric set into a new numeric arrangement [B2], wherein
- the rearranging operations for matrix [B1] are of the same type as those used to rearrange matrix [A1];
- and
- the series is codified with the second series of rearranging operations to be applied forming the keyword CK2;
- (e) applying keyword CK1 in order to rearrange the base message [A1], thus generating the intermediate message [A2];
- and applying keyword CK2 in order to rearrange a numeric set [B1], thus generating the new numeric arrangement [B2];
- (f) defining a substitution alphabet [A0] by specifying the number and type of characters included, along with the position each of them will have in said alphabet, wherein
- the substitution alphabet has a circular structure, whereby the next letter following the last one is the first letter in the series;
- (g) establishing, by using the new numeric arrangement [B2], the position in the intermediate message [A2] from which the substitution shall begin and also the touring direction in said message, wherein
- the position is coded within keyword CK3 by specifying the operation to be followed in order to build a ciphered message [C1];
- (h) establishing a replacing operation to replace each character in the intermediate message [A2] with another character which is obtained by moving in a certain number of positions, the location of the original character within the substitution alphabet [A0], wherein
- the displacement for the replacement of the characters in the message is done in progressively or regressively, and in the touring direction of the message as defined in CK3 in order to pursue the substitution;
- blank spaces, asterisks, numbers and other special characters not defined in the substitution alphabet remain unmodified in the ciphered message except for accented vowels, which are handled as non-accented vowels;
- and in case of having to substitute a character defined in the substitution alphabet which appears in the intermediate message in uppercase, the corresponding substitution character also being displayed in uppercase;
- (i) initiating the ciphering by identifying in the new numeric arrangements [B2] the initial cipher position number from which the substitution will start and identifying the character located in said position within the intermediate message [A2];
- (j) identifying the position in alphabet [A0] of the first character to substitute and establishing the location of the substitution character by moving in the substitution alphabet from the original position of the character to replace as many positions as indicated by the initial cipher;
- (k) replacing the original character in the intermediate messages [A2] by the identified substitution character, thus establishing the first character in the ciphered message [C1], wherein
- said replacement operation is repeated for stages (i) to (k) for each successive character within the intermediate message [A2], following the touring direction as defined in keyword CK3, thus producing the ciphered message [C1];
- (l) transmitting to the recipient correspondent the numeric set [B1] or its identification code and the ciphered message [C1], using a communication channel which does not need to be protected;
- (m) transmitting to the recipient correspondent, the substitution alphabet [A0] or its identification code, and keywords CK1 to CK3, through a protected channel;
- and
- (n) deciphering the message by the recipient correspondent by applying the method inversely described in stages (i) to (k), based upon the substitution alphabet, keywords CK1 to CK3, the ciphered message, and the original numeric set.