传统的一次一密方案由于使用与消息等长的随机密钥,产生与原文没有任何统计关系的随机输出,因此该密码算法安全性很高,加密方案很难破解。但该方案中密钥只能使用一次,不然便给攻击者留下了从频度上攻击的缺口,且密钥太长传递不安全、不利于保存。针对一次一密方案的固有缺陷,本文提出了一种基于黑洞理论的密码算法,该算法基于任意的四位十进制正整数,在至多进行7步重排求差运算后,回归到一个定数的性质,从而实现了对于给定的明文、用确定的密钥加密而随机产生的密文每次都不相同,该方案可使一串密钥循环使用多次,一定程度上缓解了一次一密方案的固有缺陷。
Due to the use of long random key and random output with no statistical relationship between the plaintext, the security of one-time pad plan is very high and cannot be decoded. But the key can be used only once, otherwise it gave attackers a gap from the frequency, and the key is too long to pass or save safely. To the defects of one-time pad, this paper puts forward an algorithm based on the law that any four digit positive integer (Not all the same four figures) will return to a constant number 6174 for up to 7 steps after rearrangement for subtraction, so to the given plaintext and the given key, the ciphertext can be different every time, thus, a string of key can be circularly used for a couple of times which contributes to relieve one-time pad’s inherent de-fects in part.