⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testdata.py

📁 python的加密库
💻 PY
📖 第 1 页 / 共 3 页
字号:
##  testdata.py : Test data for the various algorithms## Part of the Python Cryptography Toolkit## Distribute and use freely; there are no restrictions on further# dissemination and usage except those imposed by the laws of your# country of residence.  This software is provided "as is" without# warranty of fitness for use or suitability for any purpose, express# or implied. Use at your own risk or not at all.##  Data for encryption algorithms is saved as (key, plaintext,# ciphertext) tuples.  Hashing algorithm test data is simply# (text, hashvalue) pairs.# MD2 validation datamd2= [     ("", "8350e5a3e24c153df2275c9f80692773"),     ("a", "32ec01ec4a6dac72c0ab96fb34c0b5d1"),     ("abc", "da853b0d3f88d99b30283a69e6ded6bb"),     ("message digest", "ab4f496bfb2a530b219ff33031fe06b0"),     ("abcdefghijklmnopqrstuvwxyz", "4e8ddff3650292ab5a4108c3aa47940b"),     ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",      "da33def2a42df13975352846c30338cd"),     ("12345678901234567890123456789012345678901234567890123456789012345678901234567890",      "d5976f79d83d3a0dc9806c3c66f3efd8")     ]# MD4 validation datamd4= [      ('', "31d6cfe0d16ae931b73c59d7e0c089c0"),      ("a",   "bde52cb31de33e46245e05fbdbd6fb24"),      ("abc",   "a448017aaf21d8525fc10ae87aa6729d"),      ("message digest",   "d9130a8164549fe818874806e1c7014b"),      ("abcdefghijklmnopqrstuvwxyz",   "d79e1c308aa5bbcdeea8ed63df412da9"),      ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",       "043f8582f241db351ce627e153e7f0e4"),      ("12345678901234567890123456789012345678901234567890123456789012345678901234567890",      "e33b4ddc9c38f2199c3e7b164fcc0536"),     ]# MD5 validation datamd5= [    ('',  "d41d8cd98f00b204e9800998ecf8427e"),    ('a', "0cc175b9c0f1b6a831c399e269772661"),    ('abc', "900150983cd24fb0d6963f7d28e17f72"),    ('message digest', "f96b697d7cb7938d525a2f31aaf161d0"),    ('abcdefghijklmnopqrstuvwxyz', "c3fcd3d76192e4007dfb496cca67e13b"),    ('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',               "d174ab98d277d9f5a5611c2c9f419d9f"),    ('12345678901234567890123456789012345678901234567890123456789'     '012345678901234567890', "57edf4a22be3c955ac49da2e2107b67a")     ]# Test data for SHA, the Secure Hash Algorithm.sha = [       ('abc', "a9993e364706816aba3e25717850c26c9cd0d89d"),       ('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq',        "84983e441c3bd26ebaae4aa1f95129e5e54670f1"),       (1000000 * 'a', '34aa973cd4c4daa4f61eeb2bdbad27316534016f'),      ]sha256 = [       ('abc', "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"),       ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",        "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"),       ("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu",         "cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1"),       ("Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.  Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war.  We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live.  It is altogether fitting and proper that we should do this.  But, in a larger sense, we can not dedicate--we can not consecrate--we can not hallow--this ground.  The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract.  The world will little note, nor long remember what we say here, but it can never forget what they did here.  It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced.  It is rather for us to be here dedicated to the great task remaining before us--that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion--that we here highly resolve that these dead shall not have died in vain--that this nation, under God, shall have a new birth of freedom--and that government of the people, by the people, for the people, shall not perish from the earth.  -- President Abraham Lincoln, November 19, 1863",         "4d25fccf8752ce470a58cd21d90939b7eb25f3fa418dd2da4c38288ea561e600"),       ("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"),       ("This is exactly 64 bytes long, not counting the terminating byte", "ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8"),       ("For this sample, this 63-byte string will be used as input data", "f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342"),       ("And this textual data, astonishing as it may appear, is exactly 128 bytes in length, as are both SHA-384 and SHA-512 block sizes",         "0ab803344830f92089494fb635ad00d76164ad6e57012b237722df0d7ad26896"),       ("By hashing data that is one byte less than a multiple of a hash block length (like this 127-byte string), bugs may be revealed.",         "e4326d0459653d7d3514674d713e74dc3df11ed4d30b4013fd327fdb9e394c26"),       ("qwerty" * 65536,        "5e3dfe0cc98fd1c2de2a9d2fd893446da43d290f2512200c515416313cdf3192"),       ("Rijndael is AES" * 1024,        "80fced5a97176a5009207cd119551b42c5b51ceb445230d02ecc2663bbfb483a"),       (1000000 * 'a', 'cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0'),       ]ripemd = [ ("", "9c1185a5c5e9fc54612808977ee8f548b2258d31"),           ("a", "0bdc9d2d256b3ee9daae347be6f4dc835a467ffe"),           ("abc", "8eb208f7e05d987a9b044a8e98c6b087f15a0bfc"),           ("message digest", "5d0689ef49d2fae572b881b123a85ffa21595f36"),           ("abcdefghijklmnopqrstuvwxyz",            "f71c27109c692c1b56bbdceb5b9d2865b3708dbc"),           ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",            "12a053384a9c0c88e405a06c27dcf49ada62eb2b"),           ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",           "b0e20b6e3116640286ed3a87a5713079b21f5189"),           (8 *"1234567890", "9b752e45573d4b39f4dbd3323cab82bf63326bfb"),           (1000000 * 'a', "52783243c1697bdbe16d37f97f68f08325dc1528"),]#Test data for SHA256sha256 = [("abc", "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"),          ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",            "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"),		   ("abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu", 		   		"cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1"),		   ("Four score and seven years ago our fathers brought forth on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.  Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battlefield of that war.  We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live.  It is altogether fitting and proper that we should do this.  But, in a larger sense, we can not dedicate--we can not consecrate--we can not hallow--this ground.  The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract.  The world will little note, nor long remember what we say here, but it can never forget what they did here.  It is for us the living, rather, to be dedicated here to the unfinished work which they who fought here have thus far so nobly advanced.  It is rather for us to be here dedicated to the great task remaining before us--that from these honored dead we take increased devotion to that cause for which they gave the last full measure of devotion--that we here highly resolve that these dead shall not have died in vain--that this nation, under God, shall have a new birth of freedom--and that government of the people, by the people, for the people, shall not perish from the earth.  -- President Abraham Lincoln, November 19, 1863", 		   		"4d25fccf8752ce470a58cd21d90939b7eb25f3fa418dd2da4c38288ea561e600"),		   ("", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"),		   ("This is exactly 64 bytes long, not counting the terminating byte", "ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8"),		   ("For this sample, this 63-byte string will be used as input data", "f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342"),		   ("And this textual data, astonishing as it may appear, is exactly 128 bytes in length, as are both SHA-384 and SHA-512 block sizes", 		   		"0ab803344830f92089494fb635ad00d76164ad6e57012b237722df0d7ad26896"),		   ("By hashing data that is one byte less than a multiple of a hash block length (like this 127-byte string), bugs may be revealed.", 		   		"e4326d0459653d7d3514674d713e74dc3df11ed4d30b4013fd327fdb9e394c26"),		   ("qwerty" * 65536,     		    "5e3dfe0cc98fd1c2de2a9d2fd893446da43d290f2512200c515416313cdf3192"),		   ("Rijndael is AES" * 1024,   	 	    "80fced5a97176a5009207cd119551b42c5b51ceb445230d02ecc2663bbfb483a"),]sha256 = sha256[:1]# DES validation data# Key, IV, plaintext, ciphertextdes_cbc= [('0123456789abcdef', 'fedcba9876543210',           "7654321 Now is the time for \000\000\000\000", 'ccd173ffab2039f4acd8aefddfd8a1eb468e91157888ba681d269397f7fe62b4')]des = [ ('0000000000000000', '0000000000000000', '8CA64DE9C1B123A7'),    ('FFFFFFFFFFFFFFFF', 'FFFFFFFFFFFFFFFF', '7359B2163E4EDC58'),    ('3000000000000000', '1000000000000001', '958E6E627A05557B'),    ('1111111111111111', '1111111111111111', 'F40379AB9E0EC533'),    ('0123456789ABCDEF', '1111111111111111', '17668DFC7292532D'),    ('1111111111111111', '0123456789ABCDEF', '8A5AE1F81AB8F2DD'),    ('0000000000000000', '0000000000000000', '8CA64DE9C1B123A7'),    ('FEDCBA9876543210', '0123456789ABCDEF', 'ED39D950FA74BCC4'),    ('7CA110454A1A6E57', '01A1D6D039776742', '690F5B0D9A26939B'),    ('0131D9619DC1376E', '5CD54CA83DEF57DA', '7A389D10354BD271'),    ('07A1133E4A0B2686', '0248D43806F67172', '868EBB51CAB4599A'),    ('3849674C2602319E', '51454B582DDF440A', '7178876E01F19B2A'),    ('04B915BA43FEB5B6', '42FD443059577FA2', 'AF37FB421F8C4095'),    ('0113B970FD34F2CE', '059B5E0851CF143A', '86A560F10EC6D85B'),    ('0170F175468FB5E6', '0756D8E0774761D2', '0CD3DA020021DC09'),    ('43297FAD38E373FE', '762514B829BF486A', 'EA676B2CB7DB2B7A'),    ('07A7137045DA2A16', '3BDD119049372802', 'DFD64A815CAF1A0F'),    ('04689104C2FD3B2F', '26955F6835AF609A', '5C513C9C4886C088'),    ('37D06BB516CB7546', '164D5E404F275232', '0A2AEEAE3FF4AB77'),    ('1F08260D1AC2465E', '6B056E18759F5CCA', 'EF1BF03E5DFA575A'),    ('584023641ABA6176', '004BD6EF09176062', '88BF0DB6D70DEE56'),    ('025816164629B007', '480D39006EE762F2', 'A1F9915541020B56'),    ('49793EBC79B3258F', '437540C8698F3CFA', '6FBF1CAFCFFD0556'),    ('4FB05E1515AB73A7', '072D43A077075292', '2F22E49BAB7CA1AC'),    ('49E95D6D4CA229BF', '02FE55778117F12A', '5A6B612CC26CCE4A'),    ('018310DC409B26D6', '1D9D5C5018F728C2', '5F4C038ED12B2E41'),    ('1C587F1C13924FEF', '305532286D6F295A', '63FAC0D034D9F793'),    ('0101010101010101', '0123456789ABCDEF', '617B3A0CE8F07100'),    ('1F1F1F1F0E0E0E0E', '0123456789ABCDEF', 'DB958605F8C8C606'),    ('E0FEE0FEF1FEF1FE', '0123456789ABCDEF', 'EDBFD1C66C29CCC7'),    ('0000000000000000', 'FFFFFFFFFFFFFFFF', '355550B2150E2451'),    ('FFFFFFFFFFFFFFFF', '0000000000000000', 'CAAAAF4DEAF1DBAE'),    ('0123456789ABCDEF', '0000000000000000', 'D5D44FF720683D0D'),    ('FEDCBA9876543210', 'FFFFFFFFFFFFFFFF', '2A2BB008DF97C2F2'),    ('0101010101010101', '95F8A5E5DD31D900', '8000000000000000'),    ('0101010101010101', 'DD7F121CA5015619', '4000000000000000'),    ('0101010101010101', '2E8653104F3834EA', '2000000000000000'),    ('0101010101010101', '4BD388FF6CD81D4F', '1000000000000000'),    ('0101010101010101', '20B9E767B2FB1456', '0800000000000000'),    ('0101010101010101', '55579380D77138EF', '0400000000000000'),    ('0101010101010101', '6CC5DEFAAF04512F', '0200000000000000'),    ('0101010101010101', '0D9F279BA5D87260', '0100000000000000'),    ('0101010101010101', 'D9031B0271BD5A0A', '0080000000000000'),    ('0101010101010101', '424250B37C3DD951', '0040000000000000'),    ('0101010101010101', 'B8061B7ECD9A21E5', '0020000000000000'),    ('0101010101010101', 'F15D0F286B65BD28', '0010000000000000'),    ('0101010101010101', 'ADD0CC8D6E5DEBA1', '0008000000000000'),    ('0101010101010101', 'E6D5F82752AD63D1', '0004000000000000'),    ('0101010101010101', 'ECBFE3BD3F591A5E', '0002000000000000'),    ('0101010101010101', 'F356834379D165CD', '0001000000000000'),    ('0101010101010101', '2B9F982F20037FA9', '0000800000000000'),    ('0101010101010101', '889DE068A16F0BE6', '0000400000000000'),    ('0101010101010101', 'E19E275D846A1298', '0000200000000000'),    ('0101010101010101', '329A8ED523D71AEC', '0000100000000000'),    ('0101010101010101', 'E7FCE22557D23C97', '0000080000000000'),    ('0101010101010101', '12A9F5817FF2D65D', '0000040000000000'),    ('0101010101010101', 'A484C3AD38DC9C19', '0000020000000000'),    ('0101010101010101', 'FBE00A8A1EF8AD72', '0000010000000000'),    ('0101010101010101', '750D079407521363', '0000008000000000'),    ('0101010101010101', '64FEED9C724C2FAF', '0000004000000000'),    ('0101010101010101', 'F02B263B328E2B60', '0000002000000000'),    ('0101010101010101', '9D64555A9A10B852', '0000001000000000'),    ('0101010101010101', 'D106FF0BED5255D7', '0000000800000000'),    ('0101010101010101', 'E1652C6B138C64A5', '0000000400000000'),    ('0101010101010101', 'E428581186EC8F46', '0000000200000000'),    ('0101010101010101', 'AEB5F5EDE22D1A36', '0000000100000000'),    ('0101010101010101', 'E943D7568AEC0C5C', '0000000080000000'),    ('0101010101010101', 'DF98C8276F54B04B', '0000000040000000'),    ('0101010101010101', 'B160E4680F6C696F', '0000000020000000'),    ('0101010101010101', 'FA0752B07D9C4AB8', '0000000010000000'),    ('0101010101010101', 'CA3A2B036DBC8502', '0000000008000000'),    ('0101010101010101', '5E0905517BB59BCF', '0000000004000000'),    ('0101010101010101', '814EEB3B91D90726', '0000000002000000'),    ('0101010101010101', '4D49DB1532919C9F', '0000000001000000'),    ('0101010101010101', '25EB5FC3F8CF0621', '0000000000800000'),    ('0101010101010101', 'AB6A20C0620D1C6F', '0000000000400000'),    ('0101010101010101', '79E90DBC98F92CCA', '0000000000200000'),    ('0101010101010101', '866ECEDD8072BB0E', '0000000000100000'),    ('0101010101010101', '8B54536F2F3E64A8', '0000000000080000'),    ('0101010101010101', 'EA51D3975595B86B', '0000000000040000'),    ('0101010101010101', 'CAFFC6AC4542DE31', '0000000000020000'),    ('0101010101010101', '8DD45A2DDF90796C', '0000000000010000'),    ('0101010101010101', '1029D55E880EC2D0', '0000000000008000'),    ('0101010101010101', '5D86CB23639DBEA9', '0000000000004000'),    ('0101010101010101', '1D1CA853AE7C0C5F', '0000000000002000'),    ('0101010101010101', 'CE332329248F3228', '0000000000001000'),    ('0101010101010101', '8405D1ABE24FB942', '0000000000000800'),    ('0101010101010101', 'E643D78090CA4207', '0000000000000400'),    ('0101010101010101', '48221B9937748A23', '0000000000000200'),    ('0101010101010101', 'DD7C0BBD61FAFD54', '0000000000000100'),    ('0101010101010101', '2FBC291A570DB5C4', '0000000000000080'),    ('0101010101010101', 'E07C30D7E4E26E12', '0000000000000040'),    ('0101010101010101', '0953E2258E8E90A1', '0000000000000020'),    ('0101010101010101', '5B711BC4CEEBF2EE', '0000000000000010'),    ('0101010101010101', 'CC083F1E6D9E85F6', '0000000000000008'),    ('0101010101010101', 'D2FD8867D50D2DFE', '0000000000000004'),    ('0101010101010101', '06E7EA22CE92708F', '0000000000000002'),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -