Summary of the invention
The object of the invention is exactly to provide a kind of to the code characters indefinite length after feasible encryption the in clear-text passwords encryption back for solving the deficiencies in the prior art, thereby is difficult for decoded encryption method.
For solving the problems of the technologies described above technical scheme of the present invention be: a kind of circle scattering migration code-transfer ciphering method is characterized in that: it comprises the steps:
(a), transcoding step: each original plaintext code characters is carried out ASCII character respectively transform, convert corresponding character to decimal to;
(b), diffusing step: each corresponding character to decimal in code characters conversion back is multiplied each other with multiplier K respectively, and described multiplier K and each the residing position of original password character constant are linear, and wherein, K is a positive integer;
(c), bias step: each the character to decimal integral body after the diffusion is carried out the mathematics manipulation that constant offset is M, and described mathematics manipulation comprises and adding, subtracts, a kind of in the delivery, and wherein, M is a positive integer;
(d), bias step again: the individuality in each character to decimal after step (c) skew is carried out the mathematics manipulation that constant offset is N again, and described mathematics manipulation also comprises and adding, subtracts, a kind of in the delivery, and wherein, N is a positive integer;
(e), change the character step: the character to decimal after will being offset again converts the password after corresponding ASCII character promptly obtains encrypting to.
Further, between described step (c) and step (d), also have a grouping step, divide into groups with self-defined grouping character variable between adjacent two character to decimals after described grouping step will be offset.
Described self-defined grouping character variable comprises " | ", “ ﹠amp; ", a kind of in " $ ".
A plurality of original plaintext code characters are carried out cyclic transformation by step (a) to step (d) respectively and are handled.
Owing to adopted above-mentioned technical scheme; advantage of the present invention is: binding data circle scattering migration of the present invention and transcoding technology, adopt twice skew and transcoding, and produce the dynamic expansion Crypted password; thereby the performance with good opposing cipher key attacks reaches protection data information purpose of safety.
Embodiment
Below graphic extension is carried out in circle scattering migration code-transfer ciphering method combination of the present invention, will be provided an embodiment at last and be described in further detail:
If the original plaintext password that needs to encrypt is:
Now above-mentioned original plaintext password is encrypted, step is as follows:
(a), transcoding step: first original plaintext code characters is carried out ASCII character transform, convert character to decimal to and be:
(b), diffusing step: the character to decimal after first original plaintext password conversion is carried out multiplying, multiplier is K, K is the diffusion variable, and it is linear to be somebody's turn to do diffusion variable K and original plaintext code characters residing position constant in the original plaintext password string, and the character after the diffusion becomes:
(c), bias step: at above-mentioned first expressly the character to decimal integral body after character diffusion add (+M), subtract (M) or the processing of delivery (%M), this addend M, subtrahend M or modulus M are called constant offset M at this, and the character after the skew becomes:
(d), the grouping step: after the character to decimal integral body after first original plaintext code characters is carried out transcoding, diffusion, skew with any self-defined grouping character variable as " | ", “ ﹠amp; ", " $ " identify, and is used for grouping;
After first original plaintext password carried out above-mentioned steps conversion; again second original plaintext password changed; so circulation; until the conversion of finishing last original plaintext code characters; it is simpler that this kind cyclic transformation mode one by one can make encryption method implement; certainly the present technique personnel also can realize the mode that enters next step after all original plaintext code characters conversions is again realized that this all should be encompassed in the protection domain of the present invention in each step according to above-mentioned thought.
To after all original plaintext password conversions, the gained character string is as follows through above-mentioned:
Carry out again bias step (e) then: to above-mentioned single character to decimal (individuality) add (+N), subtract (N) or delivery (%N) any processing wherein, this addend N, subtrahend N or modulus N are called constant offset N at this, are transformed to:
At last each above-mentioned individual character to decimal is converted to corresponding ascii character, promptly obtain final Crypted password, Password Length after this encryption method is encrypted is unfixing, all relevant with original password length, side-play amount M, side-play amount N, if with 8 passwords, it is example that M, N are double figures, password total length after the encryption is between 24~32, therefore, be not easy to be cracked through the data after the encryption of this kind method, thereby guaranteed the safety of data information.
Provide a specific embodiment below, with clearer understanding encryption method implementation procedure of the present invention:
The setting original password is: x y z 789
(a), transcoding step: above-mentioned original plaintext password is carried out the ASCII character conversion, and the character to decimal after the conversion is:
120 121 122 55 56 57
(b), diffusing step: multiply each other with multiplier K to above-mentioned character to decimal is whole, and the position constant at multiplier K and original plaintext code characters place is linear, in the present embodiment, multiplying is as follows:
120×1 121×2 122×3 55×4 56×5 57×6,
So the decimal system after obtaining spreading is:
120 242 366 220 280 342
(c), bias step: the decimal system integral body after the above-mentioned diffusion added M, subtracts a kind of computing among M or the delivery M, in the present embodiment, adopt to add (+) computing, and M gets 20 arbitrarily, so the decimal system after being offset is:
140 262 382 240 300 362
(d), grouping step: promptly between every adjacent decimal number, divide into groups with self-defined symbol:
140|262|382|240|300|362
(e), bias step again: each individuality to above-mentioned character to decimal adds N, subtracts a kind of computing among N or the delivery N, in the present embodiment, adopt to add (+) computing, and N gets 72 arbitrarily, so tackle the skew that following data add N:
1 4 0 2 6 2 3 8 2 2 4 0 3 0 0 3 6 2
The decimal system after the skew is:
73 76 72 74 78 74 75 80 74 74 76 72 75 72 72
75 78 74
At last above-mentioned data are carried out the ASIIC transcoding again, promptly obtain final password and be:
I L H J N J K P J J L H K H H K N J
The foregoing description only is explanation technical conceive of the present invention and characteristics, and its purpose is to allow the personage who is familiar with this technology can understand content of the present invention and enforcement according to this, can not limit protection scope of the present invention with this.All equivalences that spirit is done according to the present invention change or modify, and all should be encompassed within protection scope of the present invention.