【密码学】基于 CAP 使用 Hill 密码对文本进行加密(Hill密码+多表密码+替换密码)

【密码学】基于 CAP 使用 Hill 密码对文本进行加密(Hill密码+多表密码+替换密码)

原理

Hill密码

Hill密码是一种基于线性代数的多字母替换密码。它使用矩阵乘法对明文进行加密。

加密步骤

  1. 选择一个密钥矩阵(通常是一个方阵)。密钥矩阵必须是可逆的,以便能够解密密文。
  2. 将明文分成与密钥矩阵大小相同的块。
  3. 将每个块转换为向量。
  4. 使用矩阵乘法将每个向量与密钥矩阵相乘。
  5. 将结果向量转换回字母,得到密文。

步骤

  1. 明文放入CAP的Plaintext区域

    Theres no doubt that my mother gives all her love to me. I do believe she is a great person who makes my life beautiful and meaningful. She is an easygoing and kind woman with bright eyes and a lovely smile. Although she is often busy, I still feel that I am taken good care of by her. Its a great pleasure to chat with her when I get into troubles. She always encourages me not to give up and tries to cheer me up by coming up with good solutions. In addition, I am fascinated by her cooking and writing. With her love, I feel like a fish swimming happily in a beautiful sea. Ill cherish her love forever.
    

    CAP的Plaintext区域示例

  2. 点击菜单中的Ciphers,选中Hill

    选择Hill密码

  3. 设置Matrix size为2,KEY MATRIX:

    11 8
    3 7
    

    设置密钥矩阵

  4. 选择菜单中的Key,选中Set,生成逆矩阵

    165 252
    223 39
    

    生成逆矩阵

  5. 点击菜单中的Encipher,生成密文

       28    0
       27   82
      192   97
       45   94
      237  206
       91  248
       52  253
       48  256
      188   15
      167   62
      254   28
       33   27
       38   21
       49  107
       88   73
      211   73
      197    0
        3   82
       76  230
      122   12
       92  230
       83   12
      244   85
       64  215
      152  197
       10    3
      162  144
      131    3
      232  132
       80  223
      142  231
      245  250
       28   88
       27  106
       89  117
       87  138
      217  198
       47  241
       41  184
       98   38
      115  205
       70   10
      120   55
      239  202
       71   36
       58   34
        7   12
        2   66
      109  176
      236  235
       34  180
       72    8
      187  151
       34  128
      185  232
       19   80
       76  187
      227  238
       33  163
       38  112
      180  187
        8  238
       10  141
       51    7
      106  189
      135   49
       23  220
       69   96
      188    4
       15    6
       22  188
       35   15
      188  120
      167  239
       89   68
       87  220
      156   76
       40  122
       23   52
      122  101
        7  164
       55  251
      196  221
       75   24
      246   63
       26   51
       17  185
       24   19
       25   93
       31  117
       96   90
      218  121
       49  195
       52  140
       84  220
       76   43
      131  176
      242   31
      253   16
      256   96
      228  196
       50   75
       76    1
      227   63
      222  222
       58    5
      202   76
       67  227
      206   34
      248  125
        0  152
       82   10
      253   33
      256   38
      231  240
      250   87
      241  165
       15  232
      121   39
      115   30
       12  254
       13   33
      220   60
       96   55
       52  153
       48  248
       30   61
       42   36
      235  164
       23  251
      100   27
       90   99
       77  108
      103   97
       95   87
       79  230
       41   17
       45   24
      220  165
       96  232
       83   89
       42   87
      226   77
       88  103
       76  254
      227   86
       23  200
       69   52
      108   44
       97   41
      164  178
      251  145
       56   68
       78  220
       60    6
       55   21
       97   12
       94   13
      153  224
      248   73
       79  208
      118   59
       71  163
      216  112
       23  180
       69    8
      183   16
      156   43
       44  233
       41   61
       85  189
      110   49
       60   71
      108   58
       85  251
      110   37
      211   68
        2  220
      196  108
       22   97
      187  228
      238   50
      243   60
       83  213
      132   82
      223  114
       96   12
      218  119
        0  104
       82  225
       21    5
       54   40
      187  214
      238   51
      213   93
       70   64
      100  180
       90    8
      181  188
      141   15
        0  176
       82   31
      230   82
       12   61
      131  176
      242   31
      245  164
       45  251
      108  243
      255   83
       40   49
      117   52
      240   23
       34   69
      110  241
      217   68
       40   67
       64  134
      132  195
      223  245
      248  196
       94   75
       35  187
      106   34
      242  152
      253   10
      181  221
      246   24
      152  118
       10  119
      153    0
      248   82
       76  230
      122   12
      235  230
       76   12
      154   15
      124  115
    

    生成密文

声明

本博客上发布的所有关于网络攻防技术的文章,仅用于教育和研究目的。所有涉及到的实验操作都在虚拟机或者专门设计的靶机上进行,并且严格遵守了相关法律法规

博主坚决反对任何形式的非法黑客行为,包括但不限于未经授权的访问、攻击或破坏他人的计算机系统。博主强烈建议每位读者在学习网络攻防技术时,必须遵守法律法规不得用于任何非法目的。对于因使用这些技术而导致的任何后果,博主不承担任何责任

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值