A Trapdoor Permutation Equivalent to Factoring
- 格式:pdf
- 大小:82.38 KB
- 文档页数:4
第2章香农理论第2章香农理论1949年,克劳德·香农(Claude Shannon )在《Bell Systems Technical journal 》上发表了一篇题为“Communication Theory of Secrecy System ”(保密系统的通讯理论)的论文,这篇论文对密码学的研究产生了重大影响。
本章我们将讨论部分香农的思想。
2.1 完善保密性首先介绍两种评价密码系统安全性的基本方法。
计算安全性这种度量只关心攻破一个密码系统在计算上所做的努力。
如果用最好的算法攻破一个密码系统也至少需要N 次操作,其中N 是一个非常大的特定数字,我们就可以称这个密码系统是计算安全的。
问题在于,在这个定义下,没有一个已知的密码系统能够被证明是安全的。
在实际应用中,如果攻击一种密码系统的已知最好的方法也需要非常长的计算机时间,人们就称该密码系统是“计算安全的”(当然,这与安全性的证明有很大区别)。
另一种方法是将密码系统的安全性归结为一些研究较为成熟的被认为是不难解的问题,以此提供计算安全性的证据。
比如,人们可以证明这样一个论断:如果给定的整数n 不能被分解,则一个给定的密码系统就是安全的。
这种类型的密码系统有时被称为“可证明安全的”,但必须理解,它只是证明了安全性是和另一个问题相关,并没有完全证明是安全的。
无条件安全性这种度量考虑的是对攻击者Oscar 的计算量没有任何限制时的安全性。
即使提供了无穷的计算资源也无法攻破的密码体制被称为是无条件安全的。
当我们讨论一个密码系统的安全性时,应该指定正在考虑的攻击类型。
在第1章,我们可以看出,一旦给定足够数量的密文,移位密码、代换密码和维吉尼亚密码对惟密文攻击都不是计算上安全的。
本节我们将研究一个对惟密文攻击是无条件安全的密码体制的相关理论。
可以证明,如果用给定的密钥仅仅加密明文中的一个元素,那么上述三种密码体制都是无条件安全的。
很显然,一个密码系统的无条件安全性不能以计算复杂性的观点来研究,因为我们允许计算时间是无限的。
密码学的两大基本变换
在密码学中,常用的两大基本变换是代换和置换。
1. 代换(Substitution):代换是将明文中的每个字符或者每组字符替换为另一个字符或者字符组成的过程。
代换可以通过使用一个预定义的替换表或者算法来实现。
代换的目的是打乱明文的结构,增加密码的复杂性,使得密文与明文之间的关联不易被发现。
2. 置换(Transposition):置换是通过改变明文中字符或者字符组的位置来进行加密。
置换可以按照一定的规则或者算法进行,例如将明文的字符按照行列进行重新排列,或者采用某种特定的置换模式将明文中的字符重新排列。
置换的目的是改变明文中字符的位置关系,增加密文的随机性和复杂性。
ECC陷门函数中的特定函数在密码学领域中,ECC(椭圆曲线密码学)是一种基于椭圆曲线数学理论的公钥加密算法。
ECC陷门函数是一种特殊的函数,用于在ECC加密过程中引入安全漏洞,以便对加密数据进行破解或窃取。
1. ECC陷门函数的定义ECC陷门函数是指在椭圆曲线密码系统中故意引入的具有特殊性质的函数。
这些函数在正常情况下应该是难以计算或无法计算的,但通过合适的密钥或参数,可以使其变得可计算。
这种可计算性质被称为“陷门”。
2. ECC陷门函数的用途ECC陷门函数主要用于密码分析和攻击目的。
它们可以被用来破解加密数据、窃取私钥、篡改数字签名等。
•破解加密数据:通过使用正确的密钥或参数来计算陷门函数,在没有正确密钥或参数时,该计算过程变得非常困难甚至不可能。
•窃取私钥:通过使用特定的密钥或参数来计算陷门函数,并结合其他攻击手段,可以推导出私钥的值。
•篡改数字签名:通过使用特定的密钥或参数来计算陷门函数,可以伪造有效的数字签名,从而破坏认证和完整性。
3. ECC陷门函数的工作方式ECC陷门函数的工作方式取决于具体实现和设计。
下面介绍两种常见的ECC陷门函数:3.1. 可计算离散对数问题(CDLP)在ECC中,离散对数问题是一种基于椭圆曲线上的点运算,其难度决定了该椭圆曲线的安全性。
正常情况下,计算离散对数是一项复杂且耗费大量计算资源的任务。
然而,在引入CDLP陷门函数后,存在一个特殊参数(称为“后门”),使得在知道该参数时可以快速计算出离散对数。
这个后门参数只有攻击者或有权方知道,并且不会在正常使用过程中被泄露。
3.2. 可逆性问题另一种常见的ECC陷门函数是可逆性问题。
在正常情况下,计算该函数是困难甚至不可能的。
但在知道特定密钥或参数时,可以将该函数转化为易于计算的形式。
这种可逆性问题的存在使得攻击者可以在掌握特定密钥或参数的情况下,轻松地计算出陷门函数的结果,从而破解或窃取加密数据。
4. ECC陷门函数的安全性ECC陷门函数在密码学中被广泛讨论和研究。
全国密码学术竞赛单选题1.希尔密码是由数学家(A)提出来的。
A.Lester HillB.Charles WheatstoneC.Lyon PlayfairD.Blaise de Vigenere2.利用椭圆曲线实现ElGamal 密码体制,设椭圆曲线是E11(1,6),生成元G=(2,7),接收方A的私钥钥nA=7,公钥PA= (7, 2),发送方B 欲发送消息Pm=(10,9),选择随机数k=3,求密文Cm=(C)。
A.{ (2,3), (5, 2) }B. { (3,2), (6, 2) }C.{ (8,3), (10, 2) }D.{ (6,5), (2, 10) }3.最佳放射逼近分析方法是一种(D)的攻击方法A.选择密文攻击B.唯密文攻击C.选择明文攻击D.已知明文攻击4.凯撒密码体制是一种加法密码,现有凯撒密码表,其密钥为k=3,将密文mldrbxnhsx解密后,明文为(C)。
A.jiaoyukepxB.ijaoyukepuC.jiaoyukepuD.aojuyukepu5.1980年Asmuth和Bloom根据(D)提出了(t,n)-门限方案/doc/29941224.html,grange内插多项式B.离散对数问题C.背包问题D.中国剩余定理6.用推广的Euclid 算法求67 mod 119 的逆元(A)。
A.16.0B.32.0C.24.0D.33.07.电子认证服务提供者应当妥善保存与认证相关的信息,信息保存期限至少为电子签名认证证书失效后_____。
(A)A.五年B.十年C.十五年D.二十年8.重合指数法对(C)算法的破解最有效。
A.置换密码B.单表代换密码C.多表代换密码D.序列密码9.字母频率分析法对(A)算法最有效。
A.置换密码B.单表代换密码C.多表代换密码D.序列密码10.RSA算法的安全理论基础是(B)。
A.离散对数难题B.整数分解难题C.背包难题D.代换和置换。
加扰算法原理加扰算法原理是一种用于数据保护的加密算法。
加扰算法通过对原始数据进行转换和混淆,使其变得不可读,从而保护数据的机密性和完整性。
加扰算法的原理基于数学运算和逻辑操作。
其核心思想是将待加密的数据与密钥进行混合,通过一系列的算法操作,产生加密的输出结果。
只有拥有正确的密钥,才能对加密数据进行解密还原,否则无法获取原始数据的内容。
加扰算法通常涉及到以下几个重要的组成部分:1. 初始置换(Initial Permutation):将待加密的数据按照特定规则重新排列,以增加数据的随机性和复杂性。
2. 子密钥生成(Subkey Generation):根据密钥生成一系列的子密钥,用于在加密和解密过程中进行特定的运算。
3. 轮函数(Round Function):使用子密钥对数据进行一系列的运算和变换,包括置换、替代、混淆等,以增加算法的复杂度和安全性。
4. 轮密钥加(Round Key Addition):将生成的子密钥与数据进行逐比特的异或运算,进一步增加数据的混淆性。
5. 最终置换(Final Permutation):对加密完成的数据进行最终的排列和调整,以保证解密后的数据与原始数据一致。
通过上述步骤的组合和迭代,加扰算法可以实现较高强度的数据保护,从而用于保护重要的隐私数据和敏感信息。
不同的加扰算法具有不同的设计思路和特点,常见的加扰算法包括DES、AES等。
需要注意的是,加扰算法虽然可以提供一定程度的数据保护,但并不能完全防止被破解或攻击。
为了进一步提高数据的安全性,还需要配合安全的密钥管理和其他安全措施,以建立更为完善的数据保护体系。
密码学陷门函数密码学陷门函数(cryptographic trapdoor function)是一种特殊的密码学函数,它可以在正常情况下很容易计算,但是逆向计算则相当困难。
陷门函数在密码学中起到了重要的作用,用于构建各种加密算法和协议。
陷门函数通常是基于数学难题的,例如大素数因子分解、离散对数问题、椭圆曲线离散对数等。
这些数学问题在正常情况下难以解决,需要耗费大量的计算资源和时间。
通过将这些数学问题巧妙地转化为陷门函数,可以在计算上轻松地进行加密和解密操作。
例如,RSA加密算法就是基于大素数分解问题的陷门函数。
该算法的公钥由两个大素数的乘积组成,私钥则由两个大素数和一些其他参数组成。
加密操作只需要用公钥对消息进行加密,而解密操作则需要使用私钥对密文进行解密。
通过充分利用大素数分解的困难性,RSA算法能够提供高度的安全性。
另一个常见的陷门函数是离散对数问题。
离散对数问题是在有限域上求解指数运算的反函数的问题,即给定g、h和p,求解x的值,使得g^x ≡ h (mod p)。
目前没有已知的高效算法能够在多项式时间内解决离散对数问题,因此可以将其作为陷门函数来构建各种加密算法。
除了上述问题,椭圆曲线密码学也是一种常用的陷门函数。
椭圆曲线密码学利用了椭圆曲线上的点运算的困难性来构建加密算法和数字签名算法。
椭圆曲线上的加法和乘法运算需要使用复杂的数学运算,因此可以将其作为陷门函数来构建安全的密码系统。
陷门函数在密码学中起到了至关重要的作用。
它们不仅可以用于加密和解密操作,还可以用于数字签名、密钥交换和零知识证明等各种密码学协议。
在设计密码系统时,选择合适的陷门函数是至关重要的,需要考虑到数学问题的难度、计算复杂性、安全性等多个因素。
总结起来,密码学陷门函数是一种特殊的密码学函数,可以在正常情况下容易计算,但逆向计算却非常困难。
它们通常基于数学难题,如大素数分解、离散对数问题和椭圆曲线离散对数等。
陷门函数在密码学中起着至关重要的作用,被广泛应用于加密算法、数字签名、密钥交换和零知识证明等领域。
Symmetric-key Cryptography of AESLixinShanghai University of Electric Power School of computer science and technology, Shanghai Pudong New Area1543101883@Symmetric-key algorithms are a class of algorithms for cryptography that use the same cryptographic keys for both encryption of plaintext and decryption of ciphertext. The keys may be identical or there may be a simple transformation to go between the two keys. The keys, in practice, represent a shared secret between two or more parties that can be used to maintain a private information link. This requirement that both parties have access to the secret key is one of the main drawbacks of symmetric key encryption, in comparison to public-key encryption.2, the advanced encryption algorithm AES[2]Advanced Encryption Standard (Advanced Encryption Standard, AES), in cryptography is also called Rijndael encryption method, is the United States federal government adopted a block encryption standard. This standard is used to replace the original DES, have been various analysis and widely used all over the world. After five years of the selection process, the advanced encryption standard by the United States National Institute of standards and Technology (NIST) released in November 26, 2001 in FIPS PUB 197, and in May 26, 2002 of become effective standard. On 2006, the advanced encryption standard has become the most popular symmetric key encryption algorithm. The algorithm for the Belgian cryptographer Joan Daemen and Vincent Rijmen designed, combining the two author's name, the name to Rijndael, contributors to the advanced encryption standard selection process.(Rijndael "Rhine Doll" pronunciation.).2.1 introduction to AlgorithmsAlthough AES still has different view, but on the whole, AES as a new generation of data encryption standard convergence of strong security, high performance, high efficiency, ease of use and flexibility. AES is designed with three key length: 128192256 bits, in relative terms, 128 of AES than DES key 56 key 1021 times.2.2 algorithm principle and process[3]Clear data packet length for 128 or 16 bytes, key length can be 16,24, or 32 bytes (128192 or 256).According to the length of the key, the algorithm referred to as AES-128, AES-192, AES-256.The password by N wheel, wherein the wheel based on the key length: 16 bytes 24 bytes 10 round key is a key corresponding to the 12 round, 14 round, 32 byte keys.The last round only contains three transform, in the first round in front of an initial single transform (add round key), can be seen as 0 wheel.Clear data packet length for 128 or 16 bytes, key length can be 16,24, or 32 bytes(128192 or 256).According to the length of the key, the algorithm referred to as AES-128, AES-192, AES-256.The password by N wheel, wherein the wheel based on the key length: 16 bytes 24 bytes 10 round key is a key corresponding to the 12 round, 14 round, 32 byte keys.The last round only contains three transform, in the first round in front of an initial single transform (add round key), can be seen as 0 wheel.(1) it is not a Feistel structure.The structure of Feistel is a block cipher, generally divided into one of 64 groups, one group of left and right part, general for the 16 iterations, each iteration after the exchange of left and right position, can conduct their own design: packet size key length round number sub key generation wheel function(2) the input key is extended by 44 32 bit words consisting of an array of w[i].(3) consists of 4 distinct phases, including a replacement and three place:Bytes instead of (SubBytes): S box with a completion packet bytes into bytes instead of.Line shift (ShiftRows): a simple replacement.Column (MixColumns): confusion with domain GF (28) of the arithmetical properties of a place.Add round key (AddRoundKey): current packet and extended key part is the bitwise XOR.(4) the algorithm structure is simple.On encryption and decryption operations, the algorithm consists of add round key start, followed by 9 rounds of iterations, each round contains all 4 phases instead, followed by a tenth round of three stages.(5) only add round key stages using a secret key.(6) add round key is XOR, the other three stages to provide diffusion and confusion, nonlinear function, this method is very effective and very safe.(7) for each phase are inverse.(8) the decryption algorithm in the reverse mode using the extended key.But the AES decryption and encryption algorithms are not the same.(9) when all four phase inversion, it is easy to prove that the decryption function can recover the original plaintext.(10) the process of encryption and decryption of the last round only contains three stages.1, bytes instead of transformationSimple table lookup operation.AES defines a S box, which is a 16X16 byte matrix, contains 8 bits can represent the number 256 a replacement. Bytes: S box mapping: the 4 bytes of high as row value, low 4 bits for the column value, to these ranks value as index from S box position corresponding to the removed elements as output. For example, sixteen hexadecimal number {95} corresponding to the S box of 9 rows and 5 columns in the S box, the value of {2A}, so {95} is substituted for the {2A}.Inverse S box with a similar, backstepping .2, the row shift transform4X4 state first row of matrix unchanged, second rows of circular shift left one byte,third left circular shift of two bytes, fourth rows of three byte circular shift to left.3, the column obfuscationEach column of each byte is mapped to a new value, this value is 4 bytes in the column by function transformation.4, add round key transformationIn the add round key transformation, 128 state matrix according to a 128 position with the round key XOR. Reverse round key with transform and positive add round key transform, because the XOR operation is its own inverse.5, the key expansionInput key directly copied to the array of the first extended key words. Then, each with four characters to fill the remainder of the extended key array. In the extended key array, each new word w[i] relies on the w[i-1] and w[i-4].In four cases, three using the xor. On the w array subscript is multiple of 4 element uses a more complex functions to calculate the.The G function:1, word cycle function is to make one word in 4 byte shift left one byte, the input word is [B0, B1, B2, B3] transform into [B1, B2, B3, B0].2, word instead of the S box to the input word in each byte instead.3, the results with round or different constant Rcon[j].Wheel constant:Wheel constant is a word, the word to the right of three bytes for a total of 0.Thus the words and Rcon dissimilarity or, only with the word the left byte or different. Each round of the round constants are different, the definition for the Rcon[j]= (RC[j], 0,0,0), whereRC[1]=1, RC[j]=2, RC[j-1].The value of RC[j] to sixteen hexadecimal representation for:Equivalent inverse cipherAES encryption algorithm and encryption algorithm is different. In spite of encryption and decryption key expansion of the form is the same, but in the decryption transform in different order.Two improvements to enable decryption algorithm structure and algorithm structure of the same. In the encryption process, the wheel structure for bytes instead, shift rows, columns of confusion, add round key. In the standard in the decryption process, the wheel structure for retrograde transposition, Inverse Substitute Bytes, add round key column, reverse confusion. Therefore, in deciphering round in the first two stages should be exchanged, after the two stages also need to exchange.Reverse line shift effect in state byte order, but not change the byte content, also do not depend on the byte content to its transformation. Reverse bytes instead of state byte content, but do not change the byte order also do not depend on the byte sequence to its transformation. Therefore, the two operation can exchange. For a given state S: Reverse migration [reverse bytes instead of (S)] = reverse bytes instead of [reversemigration (S)]Add round key and reverse column confusion does not change the state byte order. If we take the key as a word sequence, then add round key and reverse column confused every time on the state column operation. The two operation on the column input is linear. For a given state of S and given wheel key W:Reverse column (S W confusion) =[reverse column confusion (S)] [column reverse confusion (W)]Note:(1) for calculating the round key is used in the reverse column obfuscating transformations, can use the corresponding reverse column transform algorithm instead of the four array, which can save the space of 4K.And, due to the reverse column transform in the AES implementation in the round key generation using, for the algorithm not to add / solution performance impact.(2) wheel constant cycle of 51 (from before 52 generation wheel constant known), and the AES algorithm with a maximum before the 14 round constants.2.4 Algorithm and ApplicationRijndael algorithm is flexible, simple, against multiple cipher analysis advantages, its goal is to develop into can be safely used for commercial, political and military encryption algorithm. In addition, the AES algorithm for hardware implementation of speed is about 3 times the software implementation, it is to realize with hardware encryption provides a very good opportunity. With the rapid development of network technology, network data encryption requirements increasing, the application of AES in a first embodiment of network information safety in the field.The application of the wireless networkAs wireless communication channel than the wired network is more open, the security requirements of higher. In order to guarantee the security of the data transfer, some wireless networks using AES. For example, ZigBee technology, to ensure that the MAC frame integrality, confidentiality, authenticity and consistency, the MAC layer is encrypted using the AES algorithm, and generates a series of security mechanism.Application of electronic commerceIn respect of electronic business affairs , mainly AES in e-commerce platform of cryptographic protocols and transaction security protocol. For example, the application of AES in SSL (Secure Sockets Layer secure socket layer) protocol. Through the AES encrypted data and transmits to each other. The receiver can use the AES key to get specific real-time data. The typical research include: AES and RSA hybrid encryption system using the NTRU public key cipher system; distribution of AES key; AES and ECC (elliptic curve cryptography) combination of encryption system.Application of AES softwareIn AES software, the application field of contains voice, video information encryption, data encryption. Nowadays multimedia information encryption problems highlighted. Because the multimedia information data is very big, directly to its encryption efficiency is low. So, we should consider not only the data encryption algorithm using AES method, and corresponding design on multimedia information encryption process. About AES in the application database, mainly in how data input, output in generation, distribution andmanagement of the key data encryption and security strategy.AES Hardware ApplicationIn AES hardware implementation, the main direction of RF IC card data security, smart card and hard disk data encryption etc. The RF IC card application scope is very broad, such as bus IC card, campus card.Reference[1] Internet Baidu Encyclopedia /view/7591.htm.2012/12/5.[2] John Savard's description of the AES algorithm/crypto/co040401.htm.2012/12/5.[3] [the]William Stallins; King Zhang Yi Yang Min Du Ruiying Deng, cryptography and network security P105-127.[4]E.Biham,A.Shamir.Differential cryptanalysis of DES-like cryptosystems[J].Journal of Cryptology,1 991,4(1):3—72.[5] E.Biham,A.Shamir.Defferential fault analysis of secret key cryptosytems[A].In:Advances in Cryptology·CRYPTO’97[C].Lecture Notes in ComputerScience 1294,Berlin:Springer-Verlag,1 997:5 1 3-525.[6] M.Mitsuru.Linear cryptanalysis method for DES cipher[A].In:Advances inCryptology—EUROCRYPT’93[C].Lecture Notes in Computer Science 765,Berlin:Springer-Verlag,1 994:386-397.[7] J.-S.Coron,P Kocher,D.Naccache.Statistics and secret leakage[A].YFrankel(Ed).In:Financial Cryptography-FC 2000,LNCS[C].LNCS 1 962,Berlin:Springer-Verlag,200 1:1 57~1 73.[8] Wen Congjian computer science and technology AES differential - algebraic attack on 2009:16 ~ 22.。
aes的工作原理
AES(Advanced Encryption Standard)是一种对称加密算法,
它的工作原理如下:
1. 初始轮(Initial Round):将输入的明文划分成大小为128
位的块,并将密钥扩展成一系列轮密钥(Round Keys)。
2. 轮函数(Round Function):由多个轮(Round)组成,每
个轮包括四个步骤:字节替代(SubBytes)、行移位(ShiftRows)、列混淆(MixColumns)和轮密钥加(AddRoundKey)。
- 字节替代:将每个字节替换成S盒(Substitution Box)中对
应的值,通过非线性变换增加加密强度。
- 行移位:将每行向左循环移位,使得第1行保持不变,第2
行左移1个字节,第3行左移2个字节,第4行左移3个字节。
- 列混淆:通过矩阵乘法对每列进行混淆运算,增加信息的
扩散性。
- 轮密钥加:将每个字节与轮密钥进行异或操作,加入密钥
的信息。
3. 最后轮(Final Round):与初始轮类似,但没有列混淆步骤。
4. 重复执行多个轮函数,直到达到指定的轮数。
5. 密文生成:经过所有轮函数后,最终输出128位的密文。
总结来说,AES的工作原理是通过轮函数的迭代来对输入的明文进行混淆和替换操作,同时引入密钥来改变加密的结果。
这种迭代的设计使得AES具有较高的安全性和强大的抗攻击能力。
5..证明等式gcd(m,n)=gcd(n,m mod n)对每一对正整数m,n都成立.Hint:根据除法的定义不难证明:●如果d整除u和v, 那么d一定能整除u±v;●如果d整除u,那么d也能够整除u的任何整数倍ku.对于任意一对正整数m,n,若d能整除m和n,那么d一定能整除n和r=m mod n=m-qn;显然,若d能整除n和r,也一定能整除m=r+qn和n。
数对(m,n)和(n,r)具有相同的公约数的有限非空集,其中也包括了最大公约数。
故gcd(m,n)=gcd(n,r)6.对于第一个数小于第二个数的一对数字,欧几里得算法将会如何处理?该算法在处理这种输入的过程中,上述情况最多会发生几次?Hint:对于任何形如0<=m<n的一对数字,Euclid算法在第一次叠代时交换m和n, 即gcd(m,n)=gcd(n,m)并且这种交换处理只发生一次.7.a.对于所有1≤m,n≤10的输入, Euclid算法最少要做几次除法?(1次)b. 对于所有1≤m,n≤10的输入, Euclid算法最多要做几次除法?(5次)gcd(5,8)习题1.21.(农夫过河)P—农夫W—狼G—山羊C—白菜2.(过桥问题)1,2,5,10---分别代表4个人, f—手电筒4. 对于任意实系数a,b,c, 某个算法能求方程ax^2+bx+c=0的实根,写出上述算法的伪代码(可以假设sqrt(x)是求平方根的函数)算法Quadratic(a,b,c)//求方程ax^2+bx+c=0的实根的算法//输入:实系数a,b,c//输出:实根或者无解信息D←b*b-4*a*cIf D>0temp←2*ax1←(-b+sqrt(D))/tempx2←(-b-sqrt(D))/tempreturn x1,x2else if D=0 return –b/(2*a)else return “no real roots”else //a=0if b≠0 return –c/belse //a=b=0if c=0 return “no real numbers”else return “no real roots”5.描述将十进制整数表达为二进制整数的标准算法a.用文字描述b.用伪代码描述解答:a.将十进制整数转换为二进制整数的算法输入:一个正整数n输出:正整数n相应的二进制数第一步:用n除以2,余数赋给Ki(i=0,1,2...),商赋给n第二步:如果n=0,则到第三步,否则重复第一步第三步:将Ki按照i从高到低的顺序输出b.伪代码算法DectoBin(n)//将十进制整数n转换为二进制整数的算法//输入:正整数n//输出:该正整数相应的二进制数,该数存放于数组Bin[1...n]中i=1while n!=0 do {Bin[i]=n%2;n=(int)n/2;i++;}while i!=0 do{print Bin[i];i--;}9.考虑下面这个算法,它求的是数组中大小相差最小的两个元素的差.(算法略) 对这个算法做尽可能多的改进.算法MinDistance(A[0..n-1])//输入:数组A[0..n-1]//输出:the smallest distance d between two of its elements习题1.31.考虑这样一个排序算法,该算法对于待排序的数组中的每一个元素,计算比它小的元素个数,然后利用这个信息,将各个元素放到有序数组的相应位置上去.a.应用该算法对列表‖60,35,81,98,14,47‖排序b.该算法稳定吗?c.该算法在位吗?解:a. 该算法对列表‖60,35,81,98,14,47‖排序的过程如下所示:b.该算法不稳定.比如对列表‖2,2*‖排序c.该算法不在位.额外空间for S and Count[]4.(古老的七桥问题)习题1.41.请分别描述一下应该如何实现下列对数组的操作,使得操作时间不依赖数组的长度. a.删除数组的第i 个元素(1<=i<=n)b.删除有序数组的第i 个元素(依然有序) hints:a. Replace the i th element with the last element and decrease the array size of 1b. Replace the ith element with a special symbol that cannot be a value of the array ’s element(e.g., 0 for an array of positive numbers ) to mark the i th position is empty. (―lazy deletion ‖)第2章 习题2.17.对下列断言进行证明:(如果是错误的,请举例) a. 如果t(n )∈O(g(n),则g(n)∈Ω(t(n)) b.α>0时,Θ(αg(n))= Θ(g(n)) 解:a. 这个断言是正确的。
福尔斯密码
福尔斯密码(Furstenberg cipher)是一种古老的密码学方法,由Hillel Furstenberg于1955年提出。
它是一种置换密码,通过将明文分组并将每组分别映射到另一个置换群中来进行加密。
具体来说,福尔斯密码的加密过程如下:
选择一个置换群G和一个映射群H。
将明文按照一定的规则分组,并将每组表示为G中的一个元素。
对于每个明文分组,选择一个随机的H中的置换,并将该置换作用于该分组对应的G中的元素。
将得到的每个G中的元素拼接在一起,得到密文。
福尔斯密码的解密过程与加密过程类似,只是需要将每个H中的置换取逆。
需要注意的是,福尔斯密码的安全性取决于所选择的置换群和映射群,因此需要选择足够复杂的群来保证安全性。
X-Authentication-Warning: teak.ii.uib.no: larsr owned process doing -bs Date: Mon, 15 May 2000 14:38:35 +0200 (MET DST)From: Lars Ramkilde Knudsen <Lars.Knudsen@ii.uib.no>To: AESRound2@cc: Lars Ramkilde Knudsen <Lars.Knudsen@ii.uib.no>Subject: twofishDear NIST,Please find enclosed some pages on Twofish.Lars R. Knudsen, Assoc.Prof., Univ. of Bergen, Dept.of Informatics, PB 7800, N-5020 Bergen, Norway +47 55 58 41 57, (fax +47 55 58 41 99), Lars.Knudsen@ii.uib.no, http://www.ii.uib.no/~larsr/Trawling Twofish(revisited)∗Lars R.KnudsenDept.of InformaticsUniversity of Bergen,NorwayMay15,2000AbstractTwofish is a128-bit block cipher submitted as a candidate for the Ad-vanced Encryption Standard(AES).It has a structure related to the Feistelstructure and runs in16rounds.In this paper we consider mainly differen-tials of Twofish and show that there are differentials for Twofish for up to16rounds,predicting at least32bits of nontrivial information in every round.In addition,it holds that for anyfixed user-selected key it is possible,at leastin theory,tofind one good pair of plaintexts following the differential throughall16rounds.Also,we use thesefindings to try and distinguish(reduced)Twofish from a randomly chosen permutation.1IntroductionTwofish[16]is a secret-key encryption primitive,which is one of thefinalfive candidates for the Advanced Encryption Standard[15].Twofish is a16-round cipher which uses components from the ciphers Khufu[14],Square[1],and SAFER[13]. The128-bit plaintexts arefirst split into four words of each32bits,X0LL,X0LR,X0RL, and X0RR.The four words are then exclusive-or’ed with the32-bit round keys, K0,K1,K2,and K3respectively.Then we compute for i=0, (15)w1=g(X i LL)(1)w2=g(X i LR<<8)(2) X i+1=((w1+w2+K2i+8)⊕X i RL)>>1(3) LLX i+1=(w1+2w2+K2i+9)⊕(X i RR<<1)(4) LRX i+1=X i LL(5) RL=X i LR(6) X i+1RRThe function g consists of four key-dependent S-boxes plus a linear transformation derived from an MDS-code.The key-dependent S-boxes are computed from two fixed8-bit S-boxes q0and q1.The ciphertext is the concatenation of the values X16RL⊕K4,X16RR⊕K5,X16LL⊕K6,X16LR⊕K7.Figure1is a non-detailed picture of one round of Twofish.Here g8is the same as g but where the inputs are rotated by eight positions to the left.For a more detailed pictorial illustration of the encryption function of Twofish we refer to Figure1of[16].It follows by inspection of Figure1that Twofish does not have the classical Feistel structure as claimed.If one removes the one-bit rotations,then the resulting cipher is a Feistel cipher.Although it is possible to incorporate the one-bit rotations inside the round function by applying simple transformations,this would result in different round functions in the different rounds.1(((((((((((((((((((gg 8PHT⊕⊕Figure 1:The Twofish graph.+denotes the addition of a round key modulo 232,g 8is the function g but where the inputs are rotated 8positions to the left,and PHT(x,y )=(x +y,x +2y )both outputs modulo 232.2The Twofish S-boxes q 0and q 1In this section we analyse the fixed S-boxes used in Twofish.Each of the S-boxes q 0and q 1are constructed from four 4-bit S-boxes,t 1,t 2,t 3,and t 4.Call this con-struction the q 0,1-construction.The following fact is well-known.Fact 1Consider a function f :{0,1}r →{0,1}r .If f is a permutation,then the algebraic degree of any output bit as a function of the input bits is at most r −1.Now we can prove the following property of the S-boxes.Fact 2For any choices of the bijective 4-bit S-boxes t 1,t 2,t 3,and t 4in the q 0,1-construction each bit in the output of the resulting 8-bit S-box can be written as a function of the input bits with algebraic degree at most six.Proof.The left half of the 8-bit input in the q 0,1-construction maps one-to-one to both the left and right halves of the output,and similarly for the right half of the input.Therefore,any output bit will be of at most degree three as a function of either half of the input,totally at most degree six.Note that the nonlinear order of an S-box is not the same as the algebraic degree of the output bits.The nonlinear order of an n -bit bijective S-box is the minimum algebraic degree of the 2n −1boolean functions obtained from a linear combination of the n coordinate functions.It can be shown that the nonlinear order of a randomly chosen bijective n -bit S-box is n −2with a high probability.The authors of Twofish note [16,§7.2.1]“The construction method for building q 0and q 1from 4-bit permutations was chosen because ....without adding any apparent weaknesses to the cipher”.For a randomly chosen 8-bit permutation the probability is very high that the algebraic degree of one or more output bits as functions of the input bits is seven.So random 8-bit S-boxes have better properties than the q 0,1-construction with respect to the algebraic degrees,the question is if they are substantially better.1(((((((((((((((((((g g 8PHT ⊕⊕e f a ba b c da b ij kl Figure 2:A one-round truncated differential.3The linear transformationThe linear transformation inside the function g of Twofish is similar to the construc-tions in Square [1]and Rijndael [2].It is a permutation of a vector of four bytes,such that for any two different input vectors,the total number of different bytes in the input vector and the output vector is at least five.This provides diffusion to the cipher.Two inputs to g different in only one of the four bytes are guaranteed to differ in all four bytes at the output of g .However,this also enables an attacker to specify a so-called “truncated differential”,see e.g.[6,7,11],of probability one through the g transformation.Let (x,y,z,w )denote the difference of two vectors each of four bytes for any definition of difference,and let (x,y,z,w )g →(X,Y,Z,W )denote that two input vectors of differences x,y,z,and w in the four bytes can lead to outputs of differences X,Y,Z,and W in the four bytes.Then the diffusion property implies that for a =0the differential (a,0,0,0)g →(b 0,b 1,b 2,b 3)where b i =0for i =0,...3holds with probability one.4Differentials for TwofishIn this section we consider (truncated)differentials of Twofish.The differentials will specify the expected differences in each of the 32-bit words in the intermediate ciphertexts.Let us introduce some notation.We define the difference between two 32-bit words,X and Y asX −Y mod 232.With this definition,the difference before and after the addition of a round key is the same.Also,the PHT-transform is linear with respect to this difference.We shall write a one-round differential as(a,b,c,d )→(e,f,a,b ):(a,b )→(i,j )→(k,l ),(7)where all small letters denote a difference of two 32-bit words.The first two tuples represent the differences in the four input words and in the four output words of the particular round,see Figure 2.Here k =i +j mod 232and l =k +j mod 232.The three following pairs specify first the differences in the inputs to the g -functions,then the differences in the words before and after the PHT-transform,respectively. Also,atfirst we shall only be interested in whether the difference in a32-bit word is zero or nonzero.Here we give a two-round differential,Ω1,which has probability2−32and gives non-trivial information about at least64bits of the(intermediate)ciphertexts.(a,0,c,d)→(e,f,a,0):(a,0)→(i,0)→(i,i),p=1(e,f,a,0)→(h,0,e,f):(e,f)→(2m,−m)→(m,0),p=2−32The differential is iterative,that is,it can be concatenated with itself any number of times.If we start and end with one-round differentials of probability one,this yields(2r+1)-round differentials of probability2−(32r).Some explanation of the differential.The only requirement on the input differences is that(a,c,d)=(0,0,0). Then a=0⇒i=0,and e=0,f=0⇒m=0.In thefirst round,two inputs of nonzero difference a to g yields some nonzero difference i in the outputs of g, and since the PHT is linear with respect to the difference used,it follows that the differences in both32-bits words after addition of the round keys will be i.Note that since the outputs of the round function are combined with the right halves of the inputs to the round using the exclusive-or operation,the differences e and f are not just c⊕i and d⊕i,respectively.More precisely,let e1and e2be the two texts of difference e and similarly for the other words.Then e=e1−e2=(i1⊕c1)−(i2⊕c2) (here we ignored the one-bit rotations),where i=i1−i2and c=c1−c2.However, if the values of c and d are nonrandom and related,then so are the values of e and f.This phenonmenon will be discussed later in this paper.In the second round, the two pairs of inputs of differences e and f,respectively,lead to differences2m and−m with an average probability of2−32,where we assumed that neither e nor f is zero,which will happen with probability roughly(1−2−31)if c,d are random. Note also,that(e,f)=(0,0)with probabilty2−64if c,d are random,in which case the(rest of the)second round has a probability of one.All in all,the probability of the second round is approximately2−32.Summing up,the differential predicts32bits of information in each of two rounds,a total of64bits with a probability of(about)2−32.ForΩ1a pair of plaintexts will have a difference of(a,0,c,d),where(a,c,d)= (0,0,0).Thus,it is possible to generate2962 232≈2223pairs of plaintexts of this difference.A15-round differential will have a probability of2−224.Also,there is the following2-round iterative differential,Ω2of probability2−32 (0,b,c,d)→(e,f,0,b):(0,b)→(0,i)→(i,2i),p=1(e,f,0,b)→(0,h,e,f):(e,f)→(−m,m)→(0,m),p=2−32. Iterated to15rounds alsoΩ2will have a probability of2−224.There are2223pairs of plaintexts with the desired difference.Therefore there are totally2224pairs of plaintexts forΩ1andΩ2.Altogether,for anyfixed key,one can expect at least one good pair for one of the differentials,Ω1,Ω2for Twofish up to15rounds,that is,at least one pair of plaintexts which follows the expected values in the differential in each round.Thefirst four rows of Table1give the probabilities of the differentials, the number of plaintexts needed to generate one good pair,and the total number of good pairs for Twofish reduced to9,11,13,and15rounds.The above differentials can be extended by using a1-round differential of prob-ability one in thefirst round.One can use the following differential,Ω1,0(0,0,a,0)→(b,0,0,0):(0,0)→(0,0)→(0,0),p=1which can be concatenated withΩ1.And the following differential,Ω2,0(0,0,0,b)→(0,c,0,0):(0,0)→(0,0)→(0,0),p=1can be concatenated withΩ2.This yields(2r+2)-round differentials of probabilities 2−(32r).The“price”to pay for this improvement in probability(or one extra round) is fewer pairs of plaintexts with desired difference.There are263296=2159pairs of plaintexts for each of the two differentials with the desired input differences,a total of2160pairs.Thus for anyfixed key,one can expect to get at least one good pair for Twofish reduced to12or fewer rounds.The middle three rows of Table1give the probability of the differentials,the number of plaintexts to generate one good pair, and the total number of expected good pairs.In an attempt to get access to more #Rounds Proba-#Plaintexts Total no.Differentialsbility to generate good pairs1good pair82−96264264Ω1,0|Ω∗1,andΩ2,0|Ω∗2102−128296232122−160212815Distinguishing Twofish from a random permu-tationIn this section we use the results of the previous section to try and distinguish Twofish from a randomly chosen permutation.In a previous version of this note[4]we outline an attack using the differentials of the prevous section to distinguish Twofish reduced to9or fewer rounds.This attack considered only the zero-valued words in the differential,an approach which turned out not to work,which was explained in a rump-session talk at AES3[5].In the same talk we argued that distinguishing attacks might still work by incorporating the nonuniform distribution of differences in the nonzero words of the differential from the previous section,e.g.,the values e and f from above.Consider the differentialΩ1,restated here for convenience.(a,0,c,d)→(e,f,a,0):(a,0)→(i,0)→(i,i),p=1(e,f,a,0)→(h,0,e,f):(e,f)→(2m,−m)→(m,0),p=2−32As mentioned earlier the values of e and f cannot be determined directly from the values of c,d,and i.This is because the differences considered here are defined by subtraction modulo232,but plaintext halves are combined with the exclusive-or operation.(In addition there is a one-bit rotation affecting the value of e.) However,the values of e and f are not random for given c,d,and i.To illus-trate this,let us consider a modified variant of Twofish.Instead of combining the plaintext halves via the exclusive-or operation assume that the halves are added (word-wise)modulo232.Also,we shall ignore the one-bit rotations.Note that this yields a valid block cipher.In this case the2-round differential will be(a,0,c,d)→(c+i,d+i,a,0)p=1(c+i,d+i,a,0)→(a+m,0,c+i,d+i)p=2−32,where we have omitted to specify the differences inside the round function.In this case the differential predicts not only32bits of information in the round function of each round,but totally64bits in the ciphertexts.Note that c−d can be assumed to be known in a known or chosen plaintext attack.This property iterates to any number of rounds.It is well-known that the exclusive-or operation and addition modulo232are closely related with respect to differentials,see e.g.[10,8],therefore the values of e and f will depend on the values of c,d and i.5.1Tf-32-a scaled-down variantIn an attempt to estimate the nonuniformness of the values in the above differentials we try to make a scaled-down version of Twofish.We shall construct a variant using 8-bit words instead of32-bit words.However,for such a scaled-down version to have exactly the same structure as Twofish would mean that the8-bit permutations in the round function be constructed from1-bit permutations.Clearly such a variant is weak and it seems difficult to make a realistic scaled-down version of Twofish to 32-bit blocks.Instead we shall choose the8-bit permutation,called g above for Twofish,at random.The second8-bit permutation,called g8for Twofish above,is constructed from thefirst one by rotating the inputs2positions to the left.All additions modulo232in Twofish are replaced by additions modulo28.This also defines the PHT-tranformation.Let us denote such a scaled-down variant by Tf-32.Note that Tf-32does not resemble real Twofish,since for the latter the functions g and g8are not randomly chosen32-bit permutations.In fact,cf.earlier,the functions are built from4-bit permutations and are far from“random”.We conjecture that if there is an attack which can distinguish Tf-32from a ran-domly chosen32-bit permutation,then there is also an attack which can distinguish Twofish from a randomly chosen128-bit permutation.This is because one would expect,we think,that a Twofish variant with truly random32-bit permutations will be stronger than Twofish.And for similar reasons,if a distinguishing attack on Tf-32,the scaled-down version of Twofish,does not work,one can not transfer the conclusion to Twofish.5.2χ2-testsTo support our claim from[5]that distinguishing attacks on Twofish based on the differentials of the previous section might work,we implemented tests on versions of Tf-32.We used the following4-round differential,where we have used similar notation as earlier in this note:(0,0,a,0)→(b,0,0,0)→(c,d,b,0)→(e,0,c,d).For real Twofish this differential has probability2−32,thus it predicts that32par-ticular bits of a pair of ciphertexts will be equal,thus similar as for a randomly chosen permutation.For the reduced variant the probability is2−8.We argue(as in[5])that the distribution of the value e,c,d(a three-byte value)is nonuniform and that this can be used to distinguish this variant from a randomly chosen per-mutation.The attack goes as follows.Choose pairs of plaintexts which differ only in the third word(byte).If the pair of ciphertexts has equal values in the second word,record the values of the difference in thefirst,third and fourth words(e,c,d above).One possible tool to measure nonuniformity is theχ2-test[12,9].In aχ2test, the observedχ2statistic is compared toχ2a,m−1,the threshold for theχ2test with m−1degrees of freedom and with significance level a.For the Twofish variant we choose aχ2-test with224−1degrees of freedom.For a randomly chosen function one would get aχ2-value of224−1=16,777,215in50%of the cases.We give here other significance levels for tests with224−1degrees of freedom.Level0.500.600.750.900.99#plaintexts2152162172187ConclusionIn this paper we analysed the AES-candidate Twofish.First,we showed that the Twofish S-boxes have properties not present in randomly chosen S-boxes,and that the linear transformation allows for truncated differentials of probability one.Sec-ond,we showed that there exists differentials for Twofish for up to16rounds, predicting at least32bits of nontrivial information in every round.Moreover,the probabilities of these differentials are high enough such that one can expect tofind one good pair of plaintexts following the differential through all16rounds for any fixed key.This is mainly due to the structure of the round function of Twofish. In this part of our analysis we did not make use of any intrinsic properties of the S-boxes and linear transformations in Twofish.We believe that ourfindings will only be improved taking such an approach.Third,we showed that it is possible to use the differentials to distinguish a scaled-down version of Twofish reduced to four rounds from a randomly chosen permutation contrary to what has been claimed by the designers.We are convinced that such attacks would apply to(real)Twofish as well.It is left as a(presumably hard)open problem to determine for how many rounds the distinguishing attack will work.AcknowledgmentsThe author would like to thank Eli Biham,Don Coppersmith,Willi Meier,H˚avard Raddum,and Vincent Rijmen for helpful comments.References[1]J.Daemen,L.Knudsen,and V.Rijmen.The block cipher Square.In E.Bi-ham,editor,Fast Software Encryption,Fourth International Workshop,Haifa, Israel,January1997,LNCS1267,pages149–165.Springer Verlag,1997. [2]J.Daemen and V.Rijmen.AES proposal:Rijndael.Submittedas an AES Candidate Algorithm.Description available from NIST,see /aes.[3]The Twofish Team.A Second Twofish Retreat.Pre-sented by Niels Ferguson at rump session of AES3./encryption/aes/round2/conf3/aes3agenda.html [4]L.R.Knudsen.Trawling Twofish.Technical report#189,April2000.Univer-sity of Bergen,Department of Informatics.[5]L.R.Knudsen.Trawling Twofish(revis-ited).Presentation at rump session of AES3./encryption/aes/round2/conf3/aes3agenda.html [6]L.R.Knudsen.New potentially weak keys for DES and LOKI.In A..De Santis,editor,Advances in Cryptology:EUROCRYPT’94,LNCS950,pages419–424.Springer Verlag,1995.[7]L.R.Knudsen and T.Berson.Truncated differentials of SAFER.In GollmannD.,editor,Fast Software Encryption,Third International Workshop,Cam-bridge,UK,February1996,LNCS1039,pages15–26.Springer Verlag,1995.[8]L.R.Knudsen and W.Meier.Improved differential attack on RC5.In NealKoblitz,editor,Advances in Cryptology-CRYPTO’96,LNCS1109,pages 216–228.Springer Verlag,1996.[9]L.R.Knudsen,and W.Meier.Correlations in RC6.To appear in proceedingsfrom Springer Verlag of Fast Software Encryption Workshop No.7held in New York,April,2000.[10]L.R.Knudsen,V.Rijmen,R.L.Rivest,and M.P.J.Robshaw.On the designand security of RC2.In S.Vaudenay,editor,Fast Software Encryption,Fift In-ternational Workshop,FSE’98,Paris,France,March1998,LNCS1372,pages 206–221.Springer Verlag,1998.[11]L.R.Knudsen,M.P.J.Robshaw,and D.Wagner.Truncated differentials andSkipjack.In M.Wiener,editor,Advances in Cryptology:CRYPTO’99,LNCS 1666,pages165–180.Springer Verlag,1999.[12]D.E.Knuth.The Art of Computer Programming,Vol.2.Addison-Wesley,1981.[13]J.L.Massey.SAFER K-64:A byte-oriented block-ciphering algorithm.InR.Anderson,editor,Fast Software Encryption-Proc.Cambridge Security Workshop,Cambridge,U.K.,LNCS809,pages1–17.Springer Verlag,1994.[14]R.Merkle.Fast software encryption functions.In A.J.Menezes and S.A.Vanstone,editors,Advances in Cryptology-CRYPTO’90,LNCS537,pages 476–501.Springer Verlag,1991.[15]National Institute of Standards and Technology.Advanced encryption algo-rithm(AES)development effort./aes.[16]Schneier,Kelsey,Whiting,Wagner,Hall,and Ferguson.Twofish:A128-bit block cipher.Submitted as candidate for AES Available at /twofish.html.[17]Schneier,Kelsey,Whiting,Wagner,and ments on Twofish as anAES candidate.Document,March24,2000.To be presented at AES3,April 2000.。
ATrapdoorPermutationEquivalenttoFactoring[PublishedinH.ImaiandY.Zheng,Eds.,Public-KeyCryptography,vol.1560ofLectureNotesinComputerScience,pp.219–222,Springer-Verlag,1999.]
PascalPaillier1,21GemplusCardInternational,CryptographyDepartment
34rueGuynemer,92447Issy-les-Moulineaux,Francepascal.paillier@gemplus.com2ENST,ComputerScienceDepartment
46rueBarrault,75634ParisCedex13paillier@inf.enst.fr
Abstract.InEurocrypt’98[1],Okamotoetal.exhibitedanewtrapdoorfunctionbasedontheuseofaspecialmoduli(p2q)allowingeasydiscretelogarithmcomputations.Theauthorsprovedthatthescheme’sresistancetochosen-plaintextattacksisequivalenttofactoringn.Unfortunately,theproposedschemesuffersfromnotbeingapermutation(theexpansionrateis∼=3),andhencecannotbeusedforpublic-keysignatures.
Inthispaper,weshowhowtorefinethefunctionintoatrapdoorper-mutationthatcanbeusedforsignatures.Interestingly,ourvariantstillremainsequivalenttofactoringandseemstobethesecondknowntrap-doorpermutation(Rabin-Williams’scheme[3]beingthefirst)provablyassecureasaprimitiveproblem.
1TheOkamoto-UchiyamaCryptosystemInEurocrypt’98,OkamotoandUchiyamaproposedanewpublic-keycryptosys-tembasedontheabilityofcomputingdiscretelogarithmsinaparticularsub-group.Namely,ifpisalargeprimeandγp⊂Z∗p2is
γp={xthenγphasagroupstructurewithrespecttothemultiplicationmodulop2andγp=p.Thefunctionlog(.):γp−→Zpwhichassociates(x−1)/ptoxisclearlywell-definedonγpandpresentsinterestinghomomorphicproperties.Inparticular,
∀x,y∈γplog(xymodp2)=log(x)+log(y)modpwhereby,asastraightforwardgeneralization,∀g∈γp,m∈Zplog(gmmodp2)=mlog(g)modp.2PascalPaillierKeySetup.Generatetwok-bitprimespandq(typically3k=1023)andsetn=p2q.Randomlyselectandpublishanumberg
gp=gp−1modp2isoforderpinZ∗p2andkeepgpsecret(notethatgp∈γp).Similarly,chooseg
h=gnmodn.Thetriple(n,g,h)formsthepublickey.Thesecretkeyis(p,q).Encryption.Pickrmby:c=gmhrmodn.
Decryption.Proceedasfollows:1.c=cp−1modp2=gm(p−1)gnr(p−1)=gmpmodp2,2.m=log(c)log(gp)−1modp.
Wereferthereaderto[1]forathoroughdescriptionofthescheme.Althoughprovablyequivalenttofactoring[5]asfaraschosen-plaintextattacksarecon-cerned,theschemesuffersfromthefactthatciphertextsareaboutthreetimeslongerthanplaintexts.Asaresult,itisimpossibletouse[1]’strapdoorasasignaturescheme.
Thenextsectionshowshowtoextendtheschemetoatrapdoorpermutation[4]overZ∗n.Interestingly,thesecurityanalysispresentedinsection3showsthatthenewencryptionfunctionisstillassecureasfactoring.
2TheNewTrapdoorFunctionUsingthesamenotationsasbefore,letthemessagebe3k−2-bitlonganddefinem=m1||m2wherem1<2k−1,m2<22k−1and||standsforconcatenation.Theencryptionprocedureisasfollows.
Encryption.Splitmintom1andm2andencryptby:
c=gm1mn2modn.Thispresentsanexpensionrateof:
ρ=log()2n3k,ATrapdoorPermutationEquivalenttoFactoring3whichisverycloseto1forcommonvaluesofk.Decryption.Computec=cp−1modp2=gm1pmodp2,andm1=log(c)log(gp)−1modp,
asin[1]and1.deducemn2modpq=g−m1cmodpq2.obtainm2modpq=(mn2modpq)n−1mod(p−1)(q−1)modpq3.concludebym=m1||m2.
3EquivalencetoFactoringInthissection,weprovetheone-waynessofourencryptionfunctionunderthefactoringassumption:
Theorem1.Invertingthenewencryptionfunctionisequivalenttofactoringn.Proof(Sketch).AssumingthatthereexistsaprobabilisticpolynomialtimeTur-ingmachineMwhichdecryptsciphertextsforagiven(n,g)withanon-negligibleprobability,wetransformMintoaPPTmachineMthatfactorsnwithnon-negligibleprobability.Wedirectlyre-usetheproofargumentsfromTheorem6of[1]forshowingthestatisticalclosenessofdistributionsofciphertexts.FeedingMwithgzmodnforrandom(k+1)-bitnumbersz,weneedasinglecorrectanswerm=m1||m2torecoveranontrivialfactorofnbygcd(z−m1,n).
Alternatively,theencryptionanddecryptionfunctionscanbeusedfordigitalsignaturesaswell.Toachievethis,asignercomputesthesignatures=s1||s2ofthemessagemsuchthat
gs1sn2=h(m)modn,wherehisacollision-freeone-wayhashfunction.Notehoweverthatsinces1∈Zp
ands2∈Z∗pq,someinformationaboutpandqwillleakoutateachsignature.
Namely,collectingNsignatures(ofarbitrarymessages)willallowanattackertorecoverO(log(N))bitsofp.Wethereforerecommandtoregularlyre-generatethescheme’sparameters,possiblyaccordingtoaninternalcounter.Itisworthwhilenoticingthatourschemepresentsunderlyinghomomorphicpropertieswhichcouldbeusefulfordesigningdistributedcryptographicproto-cols(multi-signatures,secretsharing,thresholdcryptographyandsoforth).
4FurtherResearchOkamoto-Uchiyama’strapdoortechniqueisinherentlynewinthesensethatitprofoundlydiffersfromRSAandDiffie-Hellman.Itmakesnodoubtthatthistechniquecouldbedeclinedinvariouswaysfordesigningnewpublic-keycryp-tosystemsinnearfuture.