Created
July 4, 2014 08:48
-
-
Save chromabox/ea981743e159ee1827bb to your computer and use it in GitHub Desktop.
[C++]HMACをC++で書いてみた ref: http://qiita.com/chromabox/items/f22cba135a055f9c6cbf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "hmac.hpp" | |
void test() | |
{ | |
using namespace std; | |
string digest; | |
string key("keykey"); | |
string data("abcdefg"); | |
hmac_sha1::create_digest(data.c_str(),data.size(),key.c_str(),key.size(),digest); | |
cout << digest << endl; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "sha1.hpp" | |
void test() | |
{ | |
using namespace std; | |
sha1 hasher; | |
string digest; | |
string data("abcdefg"); | |
hasher.update(data.c_str(),data.size()); | |
hasher.final(digest); | |
cout << digest << endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment