凯撒移位密码算法分析c语言实现.docVIP

  • 50
  • 0
  • 约1.86千字
  • 约 3页
  • 2017-05-19 发布于重庆
  • 举报
凯撒移位密码算法分析c语言实现

加密源代码: #includestdio.h #includemath.h #includestring.h #define N 500 int main() { int i = 0, k, m, n, l; char str1[N], str2[N]; printf(This is encryption program!\n); printf(Please input proclaimed in writing:\n); gets(str1); printf(Please input the key:\n); scanf(%d, k); m = strlen(str1); printf(The txt length is %d\n, m); printf(\n------------\n); printf(ciphertext is:\n); for (i = 0; im; i++) { n = (int)str1[i]; if (str1[i] == ?) { printf(?); str2[i] = str1[i]; } else if (n96 n 123) { n = (n - 97 + k) % 26; if (n0) n = 26 + n; l = (char)(n +

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档