I need an example of RSA, DES, MD5 or SHA1

53 views
Skip to first unread message

Thomas William

unread,
Apr 25, 2015, 2:03:58 AM4/25/15
to cryptop...@googlegroups.com
Actually I need all the examples, I am beginner in the world of programming and I am 1 month ago encryption work in this project and only get run AES and ARC4. If anyone can send me some code examples of this encryption, I would be grateful.


Jeffrey Walton

unread,
Apr 26, 2015, 6:09:08 PM4/26/15
to cryptop...@googlegroups.com


On Saturday, April 25, 2015 at 2:03:58 AM UTC-4, Thomas William wrote:
Actually I need all the examples, I am beginner in the world of programming and I am 1 month ago encryption work in this project and only get run AES and ARC4. If anyone can send me some code examples of this encryption, I would be grateful.

There's lots of examples on the wiki: http://www.cryptopp.com/wiki/Main_Page

Thomas William

unread,
May 2, 2015, 1:23:33 PM5/2/15
to cryptop...@googlegroups.com
Yes, thanks. I wasn't understanding the examples but now I got it.
My doubt now is: what key is being generated in the examples.
For example, what is the AES algorithm key size which has a parameter of a DEFAULT_KEYLENGTH standard, would be 128 bits? It's the same

      #define CIPHER AES
      #define CIPHER DES
      #define CIPHER RC5
      #define CIPHER RC6       
      // Key and IV setup
      byte key[ CryptoPP::CIPHER::DEFAULT_KEYLENGTH ],
            iv[ CryptoPP::CIPHER::BLOCKSIZE ];

      ::memset( key, 0x01, CryptoPP::CIPHER::DEFAULT_KEYLENGTH );
      ::memset( iv, 0x01, CryptoPP::CIPHER::BLOCKSIZE );

What would be the key size that is being generated? how can I know?

I looked at the documents but did not quite understand.

Jean-Pierre Münch

unread,
May 2, 2015, 2:42:18 PM5/2/15
to cryptop...@googlegroups.com
Am 02.05.2015 um 19:23 schrieb Thomas William:
Yes, thanks. I wasn't understanding the examples but now I got it.
My doubt now is: what key is being generated in the examples.
For example, what is the AES algorithm key size which has a parameter of a DEFAULT_KEYLENGTH standard, would be 128 bits? It's the same

      #define CIPHER AES
      #define CIPHER DES
      #define CIPHER RC5
      #define CIPHER RC6       
      // Key and IV setup
      byte key[ CryptoPP::CIPHER::DEFAULT_KEYLENGTH ],
            iv[ CryptoPP::CIPHER::BLOCKSIZE ];

      ::memset( key, 0x01, CryptoPP::CIPHER::DEFAULT_KEYLENGTH );
      ::memset( iv, 0x01, CryptoPP::CIPHER::BLOCKSIZE );

What would be the key size that is being generated? how can I know?
Well, you can look into the class declaration to get info.
The very first argument of the VariableKeyLength class, which is a base class for CIPHER_info, holds the default keylength (in bytes).
If you need the information at run-time, there should be a function (DefaultKeyLength()) for this.

In case of AES the default keylength is 128-bit.

BR

JPM


I looked at the documents but did not quite understand.


Em domingo, 26 de abril de 2015 19:09:08 UTC-3, Jeffrey Walton escreveu:


On Saturday, April 25, 2015 at 2:03:58 AM UTC-4, Thomas William wrote:
Actually I need all the examples, I am beginner in the world of programming and I am 1 month ago encryption work in this project and only get run AES and ARC4. If anyone can send me some code examples of this encryption, I would be grateful.

There's lots of examples on the wiki: http://www.cryptopp.com/wiki/Main_Page
--
--
You received this message because you are subscribed to the "Crypto++ Users" Google Group.
To unsubscribe, send an email to cryptopp-user...@googlegroups.com.
More information about Crypto++ and this group is available at http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cryptopp-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages