Research Article
Protein Motifs to Hide GA-Based Encrypted Data
Algorithm 2
Key-Generating Algorithm.
| Input: K. | | Output: Key.//generated key | | Begin | (1) | divide Key(K, K1, K2); //divide K into two divisions k1 and k2 | (2) | For i = 1 to 2 do | | { | | L[i] = length(Ki); | | For j = 1 to L[i] do | | { | | if (i = = 1) then | | { | | dec_key1[j] = char_to_decimal(ascii(K[j])); | | new_key1[ L-(j-1) ] = dec_key1[j] – 1; | | }//if | | else { | | dec_key2[j] = char_to_decimal(ascii(K[j])); | | new_key2[j] = dec_key2[j] –(2 j); | | }//else | | }//for j | | }//for i | | k = 1; | (3) | for i = 1 to L [1] do | | for j = 1 to L [2] do | | { | | M = new_key1[i] new_key2[j]; | | If (M > 256) then M = M mod 256; | | key[k] = decimal_to_binary(ascii(M) ); | | k = k+1; | | }//for | | Return Key; | | End.//Algorithm |
|