22

所属分类:加密解密
开发工具:Visual Basic
文件大小:278KB
下载次数:8
上传日期:2009-12-22 16:01:37
上 传 者wthxx
说明:  its cryption for stream cipher

文件列表:
Usefuls.bas (32034, 2001-01-10)
bindll-declare.bas (4726, 2001-01-11)
clsCipherInstance.cls (610, 2001-01-03)
clsKeyInstance.cls (24732, 2001-01-11)
frmPassWord.frm (1968, 2001-01-11)
frmRijnDael.frm (39476, 2001-01-11)
frmRijnDael.frx (51178, 2001-01-11)
Image3.gif (51166, 2001-01-11)
Image3.rji (51184, 2001-01-12)
modRijnDael.bas (440, 2001-01-11)
modRijnDaelAlgorithm.bas (149759, 2001-01-11)
RijnDael.vbp (939, 2001-01-11)
RijnDael.vbw (303, 2001-01-12)
table.128.txt (10626, 2001-01-10)
table.192.txt (12674, 2001-01-10)
table.256.txt (14722, 2001-01-10)
Test.gif (51184, 2001-01-12)

{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;} {\f16\froman\fcharset238\fprq2 Times New Roman CE;}{\f17\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f19\froman\fcharset161\fprq2 Times New Roman Greek;}{\f20\froman\fcharset162\fprq2 Times New Roman Tur;} {\f21\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f22\fswiss\fcharset238\fprq2 Arial CE;}{\f23\fswiss\fcharset204\fprq2 Arial Cyr;}{\f25\fswiss\fcharset161\fprq2 Arial Greek;}{\f26\fswiss\fcharset162\fprq2 Arial Tur;} {\f27\fswiss\fcharset186\fprq2 Arial Baltic;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128; \red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\widctlpar\adjustright \fs20\lang2057\cgrid \snext0 Normal;}{ \s1\sb240\sa60\keepn\widctlpar\adjustright \b\f1\fs28\lang2057\kerning28\cgrid \sbasedon0 \snext0 heading 1;}{\s2\sb240\sa60\keepn\widctlpar\adjustright \b\i\f1\lang2057\cgrid \sbasedon0 \snext0 heading 2;}{\*\cs10 \additive Default Paragraph Font;}{\* \cs15 \additive \ul\cf2 \sbasedon10 Hyperlink;}{\s16\widctlpar\tqc\tx4153\tqr\tx8306\adjustright \fs20\lang2057\cgrid \sbasedon0 \snext16 header;}{\s17\widctlpar\tqc\tx4153\tqr\tx8306\adjustright \fs20\lang2057\cgrid \sbasedon0 \snext17 footer;}} {\*\listtable{\list\listtemplateid-714179716\listsimple{\listlevel\levelnfc0\leveljc0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00);}{\levelnumbers\'01;}\fbias0 \fi-720\li720\jclisttab\tx720 }{\listname ;}\listid1588075784} {\list\listtemplateid-1022608514\listsimple{\listlevel\levelnfc23\leveljc0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\'01-;}{\levelnumbers;}\fbias0 \fi-720\li1440\jclisttab\tx1440 }{\listname ;}\listid1915118871}}{\*\listoverridetable {\listoverride\listid1915118871\listoverridecount0\ls1}{\listoverride\listid1588075784\listoverridecount0\ls2}}{\info{\title Notes on the Code}{\author Jonathan Daniel}{\keywords RijnDael Cryptography AES}{\operator Jonathan Daniel} {\creatim\yr2001\mo1\dy11\min26}{\revtim\yr2001\mo1\dy12\hr9\min35}{\printim\yr2001\mo1\dy11\hr11\min52}{\version9}{\edmins13}{\nofpages2}{\nofwords1177}{\nofchars6709}{\*\company Intercity Mobile Comms}{\nofcharsws8239}{\vern89}}\paperw11906\paperh16838 \widowctrl\ftnbj\aenddoc\hyphcaps0\formshade\viewkind1\viewscale100\pgbrdrhead\pgbrdrfoot \fet0\sectd \linex0\headery709\footery709\colsx709\endnhere\sectdefaultcl {\header \pard\plain \s16\widctlpar\tqc\tx4153\tqr\tx8306\adjustright \fs20\lang2057\cgrid {\field{\*\fldinst {\cgrid0 FILENAME \\p }}{\fldrslt {\lang1024\cgrid0 C:\\tmp\\rijndael\\Readme.rtf}}}{\tab \tab }{\cgrid0 Page }{\field{\*\fldinst {\cgrid0 PAGE }}{\fldrslt {\lang1024\cgrid0 2}}}{\cgrid0 of }{\field{\*\fldinst {\cgrid0 NUMPAGES } }{\fldrslt {\lang1024\cgrid0 1}}}{ \par }}{\footer \pard\plain \s17\widctlpar\tqc\tx4153\tqr\tx8306\adjustright \fs20\lang2057\cgrid {FireClaw\tab \tab bigcalm@hotmail.com \par }}{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}} {\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8 \pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang2057\kerning28\cgrid { Notes on the RijnDael Code \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par It may surprise you to know that this is my first attempt at writing an encryption algorithm. I\rquote d like to suggest to anyone else who wants to learn about encryption that you }{\i don\rquote t }{ try and do what I did, which is try and implement one of the most advanced form of encryption available today. My brain still hurts even now\'85 \par \par My code is a translation of Paulo Barreto\rquote s (and others) optimised C code which can be downloaded }{\field\fldedit{\*\fldinst { HYPERLINK http://www.esat.kuleuven.ac.be/~rijmen/rijndael }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c000000e0c9 ea79f9bace118c8200aa004ba90b6000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c00000000726d0074696f000000000000 0000000000a00000400000004000003a69100000400000108057000040000000690000545345000000000000400000000001003a691000d7080000006f000000000000000000000000000000000000000000005c5c4e00000000}}}{\fldrslt {\ul\cf2 here}}}{. Credit must also go to Peter Raddatz for his Binworks library, which allows fast usage of bit-shifting from Visual Basic. I\rquote d normally complain about Microsoft\rquote s lack of functionality here, but New Year\rquote s resolutions prevent me. I believe that at the time of writing, (09/01/01) that this is the }{\i only}{ implementation of RijnDael in Visual Basic. \par \par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang2057\kerning28\cgrid {The Algorithm \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par The RijnDael (pronounced Rhine Doll) algorithm was adopted in October 2000 as the Advanced Encryption System (AES) by the American National Institute of Standards and Te chnology (NIST), and is soon to become the Federal Information Processing Standard (FIPS). This algorithm is a successor to what is currently used - the Data Encryption Standard (DES) which has proved to be crack-able, given enough computing resources. \par \par The RijnDael algorithm was developed by two people - Joan Daemen and Vincent Rijmen, both experts in the cryptographic community. They own the trademark on it\rquote s name too. \par \par }\pard\plain \s1\sb240\sa60\keepn\widctlpar\outlinelevel0\adjustright \b\f1\fs28\lang2057\kerning28\cgrid {The Problem and Solution \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par The only problem with the current system (DES) in place is that it can be cracked. A \ldblquote Key\rdblquote is made up of a number of bits, and there are also strategies (or \ldblquote attacks\rdblquote as cryptographers know them) to break the current public/private encryption system. The number of bits in a key (for DES, normally 40) indicates the strength of encryption. A 40-bit key has 2}{\super 40}{ combinat ions, and most hacking programs attempt to try all of these combinations, to try to reach a solution - any key can now be broken with a few hours using computers in parallel. Therefore, the US government tried to find a stronger algorithm to adopt in the future - an Advanced Encryption System (AES). They did this by hosting a competition to find the best algorithm for the job, and back in October 2000, RijnDael was announced as the winner. As the DES is currently used by the private sector, it is highly likely that the AES will be also. \par \par Essentially most ciphers contain the following parts: \par The Material: What the \ldblquote Keys\rdblquote are constructed from originally. \par The Encryption Key: Allows you to encrypt a piece of information \par The Decryption Key: Allows you to decrypt a piece of encrypted information \par \par RijnDael is a block cipher, with variable strength, of 128 bits, 192 bits or 256 bits (in future, I would\rquote ve thought any multiple of 32 will be possible). With just 128 bits, the strength means that there are 3.4*10}{\super 38}{ possible keys. This is about 3*10}{\super 26}{ times stronger than the standard DES method used at the moment. Without knowing the private decryption key, it will be impossible to decrypt an encrypted block. RijnDael encodes blocks, and blocks must be multiples of 128 bits (In my implementation at least). Why do I say impossible? Using brute force, if you had a billion computers each checking a billion combinations a second, it would still take approximately 5 billion mill ennia to decrypt a single 128bit key. Now that\rquote s what I call }{\i strong}{ encryption. \par In practice however, people will develop specific \ldblquote attacks\rdblquote on RijnDael, as they have on the standard DES, and allow this to be broken quicker. The hope is that no attack can ever be expected to take a \ldblquote reasonable\rdblquote amount of time. If you check out some of the links, they will list the currently known \ldblquote attacks\rdblquote on RijnDael. \par \par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang2057\cgrid {Implementation \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par About half-way through writing this, I realised that Visual Basic is }{\i not}{ the language to do encryption in. Just the lack of bit-shifting operations caused me a major headache (a big thank you to Peter Raddatz for his Binworks DLL), not to mention the complexity of t he algorithm in general, and the implementation of the hashing table was a pain too. Also, there are easier things than translating optimised C code into Visual Basic when you haven\rquote t a clue what the C code is trying to achieve (Quantum physics is simple by comparison). \par \par The original C-code used Byte arrays to store information, which are difficult to convert to Long arrays from Visual Basic (very easy in C of course), which is why I have stuck to Long arrays throughout the code - I haven\rquote t had any major p roblems with this conversion, except that mode CFB1 is now disgustingly hard to do. I have combined the cipher with the key, and changed the Material that the key is created from a byte array into a hexadecimal string (I apologise in advance, and this w ill be corrected in future). Encryption and Decryption Mode CFB1 is currently not supported, but I\rquote ll implement it if someone asks }{\i very}{ nicely. I\rquote ve also included a couple of structures intended for key-transferral, though these are likely to change when I find out how you are }{\i supposed }{to do it! \par The code runs reasonably quickly, though I welcome any speed increase suggestions if you have any. \par \par I expect numerous bugs within the code, so if you find any, please drop me an email at }{\field{\*\fldinst { HYPERLINK mailto:bigcalm@hotmail.com }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b020000001700000014000000620069006700630061006c006d00400068006f0074006d00610069006c002e0063006f006d000000e0c9ea79f9bace118c8200aa004ba90b360000006d00610069006c0074006f003a00620069006700630061006c006d00400068006f0074006d00 610069006c002e0063006f006d00000000006d204600002000000000000069637200204f66000046000000000000656d7000000000000000f00000000000d8080000000000000000000000000000006d00000000000000000000000000000000000000000000736f6600000000}}}{\fldrslt {\cs15\ul\cf2 bigcalm@hotmail.com}}}{ \par I\rquote ve managed to produce the same test vectors and known answer tests that the original C source produced, so I hope that most of the bugs should have been removed already. \par \par There probably will be a second version of this. The second version should include mode CFB1, bug fixes, improved error handling, removal of certain functions only used for testing (such as cipherUpdateRounds), removal of certain conditional compilations, pad encryption (when I understand it properly), and any optimisations that get suggested. The next version will be split into two projects - an ActiveX DLL for the algorithm, and a separate project for test code, which should make this a lot cleaner. \par \par If you want to use the RijnDael VB code in your own projects, please credit }{\i all}{ of the following people: \par Paulo Barreto, Joan Daemen, Vincent Rijmen, Antoon Bosselaers, Jonathan Daniel (that\rquote s me by the way), and Peter Raddatz. Source code was translated after permission from Paulo Barreto - many thanks again. \par \par If you have any questions about encryption, I very much doubt I can answer them, but I don\rquote t mind you asking (I might be able to point you in the right direction, if nothing else). \par \par {\pntext\pard\plain\fs20\cgrid \hich\af0\dbch\af0\loch\f0 -\tab}}\pard \fi-720\li1440\widctlpar\jclisttab\tx1440{\*\pn \pnlvlblt\ilvl0\ls1\pnrnot0\pnindent1440\pnhang{\pntxtb -}}\ls1\adjustright {Jonathan Daniel, January 2001. \par }\pard\plain \s2\sb240\sa60\keepn\widctlpar\outlinelevel1\adjustright \b\i\f1\lang2057\cgrid {Resources \par }\pard\plain \widctlpar\adjustright \fs20\lang2057\cgrid { \par }{\field{\*\fldinst { HYPERLINK http://www.nist.gov/public_affairs/releases/g00-176.htm }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003800000068007400740070003a002f002f007700770077002e006e006900730074002e0067006f0076002f007000750062006c00690063005f0061006600660061006900720073002f00720065006c00650061007300650073002f006700300030002d003100 370036002e00680074006d000000e0c9ea79f9bace118c8200aa004ba90b7000000068007400740070003a002f002f007700770077002e006e006900730074002e0067006f0076002f007000750062006c00690063005f0061006600660061006900720073002f00720065006c00650061007300650073002f006700300030 002d003100370036002e00680074006d000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054534500000000005c434f000000000000000000000000000000000000000000000000000000000000000000000000}} }{\fldrslt {\cs15\ul\cf2 http://www.nist.gov/public_affairs/releases/g00-176.htm}}}{ - Information relating to NIST and Rijndael \par }{\field\fldedit{\*\fldinst { HYPERLINK http://www.esat.kuleuven.ac.be/~rijmen/rijndael }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c000000e0c9 ea79f9bace118c8200aa004ba90b6000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c00000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000970ba00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\ul\cf2 http://www.esat.kuleuven.ac.be/~rijmen/ri {\*\bkmkstart _Hlt503604328}{\*\bkmkend _Hlt503604328}jndael/}}}{ - More on Rijndael (written by one of the authors) \par }{\field\fldedit{\*\fldinst { HYPERLINK http://www.esat.kuleuven.ac.be/~rijmen/rijndael }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c000000e0c9 ea79f9bace118c8200aa004ba90b6000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c00000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\ul\cf2 http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndael-fst-3.0.zip}}}{ - optimised C implementation of Rijndael, by Paulo Barreto and others. (From where I took most of the information). \par }{\field\fldedit{\*\fldinst { HYPERLINK http://www.esat.kuleuven.ac.be/~rijmen/rijndael }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c000000e0c9 ea79f9bace118c8200aa004ba90b6000000068007400740070003a002f002f007700770077002e0065007300610074002e006b0075006c0065007500760065006e002e00610063002e00620065002f007e00720069006a006d0065006e002f00720069006a006e00***00610065006c00000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\ul\cf2 http://www.esat.kuleuven.ac.be/~rijmen/rijndael/rijndaeldocV2.zip}}}{ - original specification for Rijndael. \par }{\field{\*\fldinst { HYPERLINK http://www.rijndael.com/ }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000001900000068007400740070003a002f002f007700770077002e00720069006a006e00***00610065006c002e0063006f006d002f000000e0c9ea79f9bace118c8200aa004ba90b3200000068007400740070003a002f002f007700770077002e00720069006a00 6e00***00610065006c002e0063006f006d002f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\cs15\ul\cf2 http://www.rijndael.com/}}}{ - the fan (?!?) club page. \par }{\field{\*\fldinst { HYPERLINK http://www.efa.org.au/Issues/Crypto/Welcome.html }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000003100000068007400740070003a002f002f007700770077002e006500660061002e006f00720067002e00610075002f004900730073007500650073002f00430072007900700074006f002f00570065006c0063006f006d0065002e00680074006d006c000000 e0c9ea79f9bace118c8200aa004ba90b6200000068007400740070003a002f002f007700770077002e006500660061002e006f00720067002e00610075002f004900730073007500650073002f00430072007900700074006f002f00570065006c0063006f006d0065002e00680074006d006c000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\cs15\ul\cf2 http://www.efa.org.au/Issues/Crypto/Welcome.html}}}{ - General cryptography introduction. \par Ulli on }{\field{\*\fldinst { HYPERLINK http://www.planetsourcecode.com/vb/ }{{\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b02000000170000002400000068007400740070003a002f002f007700770077002e0070006c0061006e006500740073006f00750072006300650063006f00***0065002e0063006f006d002f00760062002f000000e0c9ea79f9bace118c8200aa004ba90b48000000680074007400 70003a002f002f007700770077002e0070006c0061006e006500740073006f00750072006300650063006f00***0065002e0063006f006d002f00760062002f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000}}}{\fldrslt {\cs15\ul\cf2 http://www.planetsourcecode.com/vb/}}}{ has various tutorials and example source code on other aspects of cryptography, such as the current DES system and the original Enigma machine. \par Peter Raddatz\rquote s Binwo ... ...

近期下载者

相关文件


收藏者