我正在尝试使用PKCS5_PBKDF2_HMAC_SHA1(),以下是我的示例程序.我想确定我的结果PKCS5_PBKDF2_HMAC_SHA1()是否正确所以我通过网站http://anandam.name/pbkdf2/验证了相同的结果,我看到了不同的结果.我正确使用API吗?
如果我正确地传递盐值,我有疑问.
我在程序后粘贴了我的结果和网站结果.
请帮我理解这个.
#include <stdio.h>
#include <types.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <openssl/hmac.h>
#include <openssl/evp.h>
#include <openssl/engine.h>
#include <openssl/aes.h>
#include <openssl/rand.h>
#include <proto.h>
#define KEY_LEN 32// 32 bytes - 256 bits
#define KEK_KEY_LEN 5
#define ITERATION 1000
unsigned char salt_value[KEY_LEN];
unsigned char AESkey[KEY_LEN];
unsigned char XTSkey[KEY_LEN];
u8 fuse_key[KEY_LEN];
void main()
{
s32 i=0;
s32 len =0;
u8 *out;
u8 *rspHMAC;
const s8 pwd[] = "test";
s8 rspPKCS5[KEK_KEY_LEN * 2]; …Run Code Online (Sandbox Code Playgroud) 我需要在openssl库中使用C API来从给定的字符串中派生Key.我在哪里可以获得此示例源代码?
我正在尝试使用 OpenSSL 的PKCS5_PBKDF2_HMAC_SHA1方法。我认为如果成功则返回 0,否则返回其他值。我的问题是,非零返回值是什么意思?内存错误?使用错误?我的程序应该如何处理它(重试,退出?)?
编辑:一个必然的问题是,除了对方法本身进行逆向工程之外,还有什么办法可以解决这个问题吗?