据置换σ1与σ2,按d=2的周期置换密码体制加密明文transpositionisare和arrangementofthesy。其中σ1=(7 3 4 1 6 8 9 5 2),σ2=(4 1 2 7 9 8 5 6 3)。
时间: 2023-03-28 11:03:52 浏览: 284
经过按照周期置换密码体制加密后,明文 "transpositionisare" 变成了 "tisnrsioaopitner". 明文 "arrangementofthesy" 变成了 "raemnogtsefhtyren".
相关问题
设d=4,n=9的周期置换密码的4个置换和密文如下,求明文。 σ1 =(6 9 4 8 3 7 1 2 5) σ2 =(1 3 5 4 7 2 6 8 9) σ3 =(5 9 6 4 7 8 2 1 3) σ4 =(2 5 1 6 3 9 4 7 8) 密文:pinsaotrs toinaisre negaemrar ttnhoyfes omlaofmbs esgaxsexx。
根据周期置换密码的原理,我们可以将密文按照周期进行分组,每组长度为周期长度d=4。然后对每组进行解密,即将每个字符根据其在置换中的位置进行替换。具体步骤如下:
1. 将密文分组: pins aotr stor inai sren egaem rar ttnh oyfe soml aofm bses gaxs exx
2. 对每组进行解密:
- 第一组:pins -> spni
- 第二组:aotr -> rota
- 第三组:stor -> rots
- 第四组:inai -> niai
- 第五组:sren -> ners
- 第六组:egaem -> meage
- 第七组:rar -> rar
- 第八组:ttnh -> hntt
- 第九组:oyfe -> feoy
- 第十组:soml -> lmos
- 第十一组:aofm -> mfoa
- 第十二组:bses -> sebs
- 第十三组:gaxs -> saxg
- 第十四组:exx -> xex
3. 将解密后的每组拼接起来,得到明文: spni rota rots niai ners meage rar hntt feoy lmos mfoa sebs saxg xex
因此,明文为:spni rota rots niai ners meage rar hntt feoy lmos mfoa sebs saxg xex。
有周期置换密码中: 明文为 (today) ,加密密钥K=(53124),则密文为 () adoty yotad yadot ydtoa
有周期置换密码中,明文为 (today),加密密钥K=(53124),则密文为 yadot。
加密过程如下:
- 将加密密钥K按照字典序排序,得到K'=(12435)。
- 将明文按照加密密钥K'的顺序进行分组,每组长度为5。因此,明文可以分成两组:today → todat、ay。
- 对每组进行逆序排列,得到密文:todat → yadot、ay → ya。
- 连接两个密文,得到最终的密文:yadot。
因此,明文 (today) 经过周期置换密码加密后得到的密文为 yadot。