使用 Crypto++ 使用私钥进行签名; SHA1 与惠而浦
Using Crypto++ to sign using private key; SHA1 vs Whirlpool
我根据 RSA-PSSR-Filter-Test.zip 示例 here 使用 crypto++,它有效。
我正在尝试找到我可以可靠地使用私钥签署消息并在 Qt 应用程序中使用 public 密钥以编程方式验证其来源的东西。
我很高兴我在验证签名时实际上可以提取消息:
StringSource(signature, true,
new SignatureVerificationFilter(
verifier,
new StringSink(recovered),
SignatureVerificationFilter::THROW_EXCEPTION | SignatureVerificationFilter::PUT_MESSAGE) // SignatureVerificationFilter
); // StringSource
assert(ui->plainTextEdit->toPlainText().toStdString() == recovered);
但是 SHA1 不安全。
然后我找到了 this example 和 Whirlpool。但是,它似乎并没有提取实际的原始消息,只是声称要验证 it.Does 这段代码实际上验证了消息? ArraySink 的用法对我来说似乎有点深奥,所以我无法分辨。
bool result = false;
Verifier verifier(publicKey);
CryptoPP::StringSource ss2(decodedSignature + aMessage, true,
new CryptoPP::SignatureVerificationFilter(verifier,
new CryptoPP::ArraySink((byte*)&result,
sizeof(result))));
return result;
我尝试将代码转换为类似于 SHA1 示例,但这并没有提取任何消息:
CryptoPP::StringSource ss2(decodedSignature, true,
new CryptoPP::SignatureVerificationFilter(verifier,
new StringSink(recovered)));
是否可以使用 Whirlpool 转换此代码以实际从签名中提取消息,或者实际消息是否不包含在签名中,尽管它看起来是 PSSR?
我也想知道这里 'new' 分配的用法;这段代码真的会泄漏内存吗?
对于任何错误的术语,我深表歉意;我不在安全领域。
原来是原来的RSA-PSSR-Filter-Test.zip example can be modified to use SHA3, by using enum value SHA3_512 for instance instead of SHA1 where it occurs. (You will also need to modify some header includes and using directives.) Still not sure why I couldn't get the response out from the Whirlpool example. More details on the mailing list。
我根据 RSA-PSSR-Filter-Test.zip 示例 here 使用 crypto++,它有效。
我正在尝试找到我可以可靠地使用私钥签署消息并在 Qt 应用程序中使用 public 密钥以编程方式验证其来源的东西。
我很高兴我在验证签名时实际上可以提取消息:
StringSource(signature, true,
new SignatureVerificationFilter(
verifier,
new StringSink(recovered),
SignatureVerificationFilter::THROW_EXCEPTION | SignatureVerificationFilter::PUT_MESSAGE) // SignatureVerificationFilter
); // StringSource
assert(ui->plainTextEdit->toPlainText().toStdString() == recovered);
但是 SHA1 不安全。
然后我找到了 this example 和 Whirlpool。但是,它似乎并没有提取实际的原始消息,只是声称要验证 it.Does 这段代码实际上验证了消息? ArraySink 的用法对我来说似乎有点深奥,所以我无法分辨。
bool result = false;
Verifier verifier(publicKey);
CryptoPP::StringSource ss2(decodedSignature + aMessage, true,
new CryptoPP::SignatureVerificationFilter(verifier,
new CryptoPP::ArraySink((byte*)&result,
sizeof(result))));
return result;
我尝试将代码转换为类似于 SHA1 示例,但这并没有提取任何消息:
CryptoPP::StringSource ss2(decodedSignature, true,
new CryptoPP::SignatureVerificationFilter(verifier,
new StringSink(recovered)));
是否可以使用 Whirlpool 转换此代码以实际从签名中提取消息,或者实际消息是否不包含在签名中,尽管它看起来是 PSSR?
我也想知道这里 'new' 分配的用法;这段代码真的会泄漏内存吗?
对于任何错误的术语,我深表歉意;我不在安全领域。
原来是原来的RSA-PSSR-Filter-Test.zip example can be modified to use SHA3, by using enum value SHA3_512 for instance instead of SHA1 where it occurs. (You will also need to modify some header includes and using directives.) Still not sure why I couldn't get the response out from the Whirlpool example. More details on the mailing list。