<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3. VAIRIABLE  length of cipher
  4. VAIRIABLE  Chipher
  5. VAIRIABLE  Plain text
  6. VAIRIABLE  length of plain text
  7. cipher key 2 to 16 charaters in length (a-z)
  8. string of plain text 4 to 256 charaters in length
  9.  
  10. Use N indication to find the current position in cipher key N=1
  11. WHEN user inputs character chipher key
  12.  
  13. THEN a charater from 2 to 16 cipher key is found at N as the target value
  14.  
  15. WHEN character is found in position N+ 1 in cipher key
  16.  
  17. IF user inputs cipher key <17
  18.        IF ELSE
  19.              output display 'error cipher key over in length, please enter number from 2 to 16'
  20.               THEN the susbsiton value in N is the last character in cipher
  21.                THEN substitution value is the first character of the cipher key
  22.  
  23. WHEN
  24.             plain text 4 to 256 replace all instances of target value with substitution value
  25.  
  26.  
  27. THEN
  28.           increment N to 1 and repeat utill end of cipher key
  29.  
  30. IF user inputs plain text <257
  31.  
  32. THEN
  33.    IF ELSE
  34.        display 'error plain text over in length, please enter number from 4 to 256'
  35.  
  36. END IF
  37.         END IF
  38.        
  39. */
  40.  
  41.  
  42.  
  43.  
  44. #include <stdio.h>
  45. #include <stdlib.h>
  46. #include <string.h>
  47. int main (void)
  48. {
  49. //* length of cipher
  50.  
  51. int length_of_cipher;
  52. scanf("%d",&length_of_cipher);
  53. printf("%d\n",&length_of_cipher);
  54. if(length_of_cipher <2 || length_of_cipher >16);
  55. printf("length_of_cipher is %d\n",&length_of_cipher);
  56.  
  57. //* chipher
  58.  
  59. int chipher_key[17];
  60. printf("insert the chipher key text\n");
  61. scanf("%s\n",chipher_key);
  62. printf("chipher_key: %s\n",chipher_key);
  63.  
  64.  
  65. //* length of plain text
  66. int length_of_plain_text;
  67. scanf("%d",&length_of_plain_text);
  68. printf("%d\n", length_of_plain_text);
  69. if ((length_of_plain_text <4) || (length_of_plain_text >257)){
  70. printf("length of plain text is: %d/n",length_of_plain_text);
  71. return 0;
  72. }
  73.  
  74. //* plain text
  75. int i;
  76. char plain_text[257];
  77. printf("insert the plain_text\n");
  78. scanf("%c",&plain_text[i]);
  79. printf("plain_text: %s\n", plain_text);
  80. }
  81.  
  82. //* encryption
  83. for (int N=1; N<=length_of_plain_text;N++){
  84. for (int j=1; j<=length_of_cipher;j++){
  85. if (plain_text[N]=cipher_text[j]
  86.  
  87.  
  88.  
  89. }