Find Jobs
Hire Freelancers

C++ code in LINUX

$10-30 USD

进行中
已发布大约 7 年前

$10-30 USD

货到付款
Programming Project 3 Requirement: In this project you will implement HMAC (Keyed-hash Message Authentication Code) using SHA-512 as the building block. HMAC with key K of a input message M can be expressed as: where is the key padded out to block size, which is 1024 bits when we use SHA-512. Here, opad, ipad are specified padding constants, which is specified as follows: ipad:00110110 (36 in hexidecimal) repeated by 1024/8=128 times; opad:01011100 (5C in hexidecimal) repeated by 1024/8=128 times. We can describe the HMAC algorithm as follows: 1. Append zeros to the end of K to create a b-bit string (e.g., if K is of length 160 bits, and b = 1024 bits, then K will be appended with 864 bits of zeros to the end of K). 2. XOR (bitwise exclusive-or ) with ipad to produce b-bit block Si. 3. Append input message M to Si. 4. Apply hash to the stream generated in step 3. 5. XOR with opad to produce the b-bit block So. 6. Append the hash output from step 4 to So. 7. Apply hash to the stream generated in step 6 to produce the output of HMAC. After computing the HMAC with key K of an input message M, print it on the screen in hexadecimal format, also store the HMAC output in the output file. Your program should take three arguments: an input file name, an output HMAC file, and a key. For example, you may use the following command to compute an HMAC for the file "text1", with the HMAC output stored in the file text1-hmac, using the key hmac123456: HMAC_gen text1 text1-hmac hmac123456. If you want to use a longer key, like a key more than 512 bits, it is recommended that you put the key in a file. (Optional: you can use SHA-512 to hash the key entered in the command line to get a longer key to be used in the HMAC algorithm). You do not need to implement SHA-512 yourself. For an implementation of SHA-512, you can use an existing crypto library, Crypto++ (C++) in this project, which is installed on the virtual machine. While you are using the built-in SHA-512 functions provided by Crypto++ library, you are required to implement HMAC yourself in this program assignment. The tutorial about how to use the SHA-512 function of Crypto++ library is provided in the end of this document. You can find 5 test files: MSG1, MSG2, MSG3, text1, and hw2.pdf.gz. Please copy all those files to your directory. Tutorial to use the SHA-512 function in the crypto library Crypto++: 1. In order to use the crypto library, in your C++ source program (e.g., [login to view URL]), you need to include the right library files, and use the right namespace as follows. #include "cryptopp/cryptlib.h" #include "cryptopp/hex.h" #include "cryptopp/filters.h" #include "cryptopp/sha.h" #include "cryptopp/des.h" #include "cryptopp/aes.h" #include "cryptopp/modes.h" 2. How to compile your source program: g++ -o test1 -L. [login to view URL] -lcryptopp -L. : search library file in current directory and the specified directories. -lcryptopp : link CryptoPP library. Here, [login to view URL] is the source cpp file name to be compiled. 3. The tool function to perform SHA-512 is illustrated as follows. string sha_digest(string & plain) { string sha512digest; SHA512 hash; StringSource(plain, true, new HashFilter(hash, new StringSink(sha512digest) ) ); return sha512digest; } 4. Using the following function call to compute the hash output of the input message: string output512digest = sha_digest(plain) Here, plain is the input message stored in a string.
项目 ID: 13738868

关于此项目

10提案
远程项目
活跃7 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
10威客以平均价$90 USD来参与此工作竞价
用户头像
I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environment. I made many great projects using c++, for example, I made the tools which could convert java codes into c++ scripts, of course garbage collection included, this was very similar to a compiler, and was very complex. I also made our own mobile game using c++, I can show you the demo of client, if you like. I am very proficient in java also. I have a very good review on Freelancer.com, I never miss a project once I accept the job, you can check my review. Trust me, please let expert help you.
$100 USD 在1天之内
4.9 (158条评论)
7.1
7.1
用户头像
Hello! Please check my reviews to know a bit about me and my work. Thank you!
$80 USD 在2天之内
5.0 (47条评论)
5.5
5.5
用户头像
hi , i am an experienced C,C++ programmer and developed codes in windows , linux and mac os x platforms using IDEs like Visual studio, Eclipse, Codeblocks . u can visit my profile to view my related tasks.
$35 USD 在2天之内
4.8 (3条评论)
2.3
2.3
用户头像
A proposal has not yet been provided
$88 USD 在3天之内
5.0 (3条评论)
1.7
1.7
用户头像
I m a cryptographic engineer
$111 USD 在2天之内
0.0 (0条评论)
0.0
0.0
用户头像
I have been working as a software for more than one and half year on C++ and having good knowledge of algorithms and data structures and good problem solving skills.
$70 USD 在3天之内
0.0 (0条评论)
0.0
0.0

关于客户

UNITED STATES的国旗
BEAVERCREEK, United States
5.0
3
付款方式已验证
会员自1月 26, 2017起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。