简体   繁体   English

如何在OpenSSL中启用scrypt算法

[英]How to enable scrypt algorithm in OpenSSL

I'm trying to enable scrypt algorithm in OpenSSL 1.1.0 on Cygwin. 我正在尝试在Cygwin的OpenSSL 1.1.0中启用scrypt算法。 I used configure option enable-scrypt but it does not work. 我使用了配置选项enable-scrypt但是它不起作用。

Command for build OpenSSL: 用于构建OpenSSL的命令:

perl configure Cygwin-x86_64 --prefix="C:/OpenSSL/x64/" no-shared -static enable-scrypt

How to activate scrypt algorithm in OpenSSL? 如何在OpenSSL中激活scrypt算法?

Enable scrypt algorithm in OpenSSL... 在OpenSSL中启用scrypt算法...

It looks like you enabled it, but it appears scrypt is only available as part of PBE gear. 好像您启用了它,但是scrypt似乎仅作为PBE设备的一部分可用。 There is no separate EVP algorithm for it per se . 有它本身没有独立的EVP算法。 That is, you can't ask for a EVP_scrypt hash algorithm. 也就是说,您不能要求使用EVP_scrypt哈希算法。

Below is from Linux (not Windows) using 1.1.0 in Master. 以下是来自Linux(不是Windows)在Master中使用1.1.0的信息。 It used the same flags you used. 它使用了与您使用的相同的标志。

$ nm -D libcrypto.a 2>/dev/null | grep -i scrypt
p5_scrypt.o:
scrypt.o:

$ nm crypto/evp/scrypt.o
                 U CRYPTO_clear_free
                 U CRYPTO_malloc
                 U ERR_put_error
00000000000004d0 T EVP_PBE_scrypt
                 U EVP_sha256
                 U OPENSSL_cleanse
                 U PKCS5_PBKDF2_HMAC
0000000000000000 t scryptBlockMix

$ cat include/openssl/evp.h | grep -i scrypt
#ifndef OPENSSL_NO_SCRYPT
int EVP_PBE_scrypt(const char *pass, size_t passlen,
int PKCS5_v2_scrypt_keyivgen(EVP_CIPHER_CTX *ctx, const char *pass,

You can verify OPENSSL_NO_SCRYPT is not defined with: 您可以验证OPENSSL_NO_SCRYPT 没有定义为:

$ cat include/openssl/opensslconf.h | grep OPENSSL_NO_SCRYPT
$

Based on the above, your two choices are EVP_PBE_scrypt and PKCS5_v2_scrypt_keyivgen . 基于以上所述,您的两个选择是EVP_PBE_scryptPKCS5_v2_scrypt_keyivgen With that toehold, there does not appear to be man pages: 有了这个脚趾,似乎没有手册页:

openssl$ grep -R EVP_PBE_scrypt doc/
openssl$

openssl$ grep -R PKCS5_v2_scrypt_keyivgen doc/
openssl$

You gotta love self-documenting code :) 您必须喜欢自我记录代码:)


Here's some more information from p5_scrypt.o , but it does not look as useful as scrypt.o . 这是来自p5_scrypt.o的更多信息,但它看起来不像scrypt.o有用。 Ignore everything with a U . U忽略一切。 The only thing left that looks mildly interesting is T PKCS5_pbe2_set_scrypt (and friends), which appears to set a context option. 剩下的看上去只有一T PKCS5_pbe2_set_scrypt有趣的是T PKCS5_pbe2_set_scrypt (和朋友),它似乎设置了一个上下文选项。

$ nm crypto/asn1/p5_scrypt.o
                 U ASN1_INTEGER_get_uint64
                 U ASN1_INTEGER_it
                 U ASN1_INTEGER_new
                 U ASN1_INTEGER_set_int64
                 U ASN1_INTEGER_set_uint64
                 U ASN1_OCTET_STRING_it
                 U ASN1_STRING_set
                 U ASN1_TYPE_new
                 U ASN1_TYPE_pack_sequence
                 U ASN1_TYPE_unpack_sequence
                 U ASN1_item_d2i
                 U ASN1_item_free
                 U ASN1_item_i2d
                 U ASN1_item_new
                 U ERR_put_error
                 U EVP_CIPHER_CTX_cipher
                 U EVP_CIPHER_CTX_free
                 U EVP_CIPHER_CTX_key_length
                 U EVP_CIPHER_CTX_new
                 U EVP_CIPHER_iv_length
                 U EVP_CIPHER_key_length
                 U EVP_CIPHER_param_to_asn1
                 U EVP_CIPHER_type
                 U EVP_CipherInit_ex
                 U EVP_PBE_scrypt
                 U OBJ_nid2obj
                 U OPENSSL_cleanse
                 U PBE2PARAM_free
                 U PBE2PARAM_it
                 U PBE2PARAM_new
0000000000000030 T PKCS5_pbe2_set_scrypt
00000000000003f4 T PKCS5_v2_scrypt_keyivgen
                 U RAND_bytes
0000000000000024 T SCRYPT_PARAMS_free
0000000000000000 R SCRYPT_PARAMS_it
0000000000000018 T SCRYPT_PARAMS_new
0000000000000038 r SCRYPT_PARAMS_seq_tt
                 U X509_ALGOR_free
                 U X509_ALGOR_new
0000000000000000 T d2i_SCRYPT_PARAMS
000000000000000c T i2d_SCRYPT_PARAMS
                 U memcpy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM