Click here to Skip to main content
15,892,839 members

Chien-Chung, Chung - Professional Profile



Summary

    Blog RSS
3,458
Author
35
Authority
-1
Debator
10
Editor
5
Organiser
125
Participant
0
Enquirer
Life is nothing but choices.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
QuestionHMAC-SHA question Pin
Adam Harding4-Jun-08 5:54
Adam Harding4-Jun-08 5:54 
Hi there,

Really pleased I found your code as is the sort of thing I am looking for.

I am just trying to run it first and since my programming knowledge is very limited I have a few questions!!

For the test data you suggested:
#include "HMAC_SHA1.h"
 
BYTE Key[20] ;
BYTE digest[20] ; 

unsigned char *test = "Hi There" ; 
memset(Key, 20, 0x0b) ;
CHMAC_SHA1 HMAC_SHA1 ;
HMAC_SHA1.HMAC_SHA1(test, strlen(test), Key, sizeof(Key), digest) ;
 
// Check with digest equal to 0xb617318655057264e28bc0b6fb378c8ef146be00
// or not


...for this part above, is it just added into an already existing source code file of the program that will be run? At the moment I have linked them together in a makefile:

CC=g++

HMAC_SHA1++:test.o HMAC_SHA1.o	SHA1.o

	$(CC)	test.o	HMAC_SHA1.o	SHA1.o	-o  HMAC_SHA1++

test.o: test.cpp HMAC_SHA1.h

	$(CC) -c test.cpp

SHA1.o: SHA1.cpp SHA1.h

	$(CC) -c SHA1.cpp

HMAC_SHA1.o: HMAC_SHA1.cpp HMAC_SHA1.h

	$(CC) -c HMAC_SHA1.cpp


..where the file test.cpp is exactly the contents of test code you suggested above. It is giving some errors about converting between signed/unsigned ints and chars etc...so just wondering how to use that test code...does it need to be inside some sort of main() function etc to work?

...after that I am hoping to somehow do the receiver processing where the receiver calculates the digest and then compares into to the senders digest and produces an error if they do not match. I am programming in fields for the security extension header of a ULE subnetwork data unit.

Thanks alot for any help!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.