北大考研复试上机——W's Cipher

本文介绍了北大考研复试上机题目中涉及的W's Cipher解密算法。该算法要求对明文字符串进行分组凯撒加密,每组字符分别向前移动不同数量的位置。在解密时,需要逆转加密过程,通过映射字符位置和特定的循环右移操作来实现。难点在于处理超过字符串长度的密钥以及实现循环右移的操作。
摘要由CSDN通过智能技术生成

题目描述

Weird Wally's Wireless Widgets, Inc. manufactures an eclectic assortmentof small, wireless, network capable devices, ranging from dog collars,to pencils, to fishing bobbers. All these devices have very smallmemories. Encryption algorithms like Rijndael, the candidate for theAdvanced Encryption Standard (AES) are demonstrably secure but theydon't fit in such a tiny memory. In order to provide some security fortransmissions to and from the devices, WWWW uses the followingalgorithm, which you are to implement. Encrypting a message requiresthree integer keys, k1, k2, and k3. The letters [a-i] form one group,[j-r] a second group, and everything else ([s-z] and underscore) thethird group. Within each group the letters are rotated left by kipositions in the message. Each group is rotated independently of theother two. Decrypting the message means doing a right rotation by kipositions within each grou
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值