-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement openssl's GENPKEY and PKEY subcommands in library crypto #156
Comments
This issue has been mentioned on SWI-Prolog. There might be relevant details there: https://swi-prolog.discourse.group/t/curve25519-in-library-crypto/2564/13 |
Support for curve 25519 was also mentioned here: |
%% crypto_private_key(+Algo, -PrivateKey, +Options) is nondet and @triska , what do you think about this API? Does it seem reasonable to you? |
No, this API does not seem good to me, for three reasons: First, it depends on the OpenSSL-specific idiosyncrasy of making a private key also "contain" the public key, or at least assuming that the public key can always be derived from the private key alone. I think this is not a particularly sensible way to look at the situation. Second, personally, I do not like exposing too many different algorithms, using an Third, for Curve25519, this API is not as useful and general as possible as can be had with two predicates. For example, in Scryer Prolog, I have implemented key exchange with Curve25519 by providing two predicates that in total expose more functionality. One, curve25519_generator(Gs) :- length(Gs0, 32), Gs0 = [9|Zs], maplist(=(0), Zs), maplist(char_code, Gs, Gs0). The other, |
I see, do you plan to add this to SWI-Prolog's package? |
openssl provides 2 subcommands GENPKEY and PKEY which can be used to generate a private and public key pair, eg. using algorithm x25519
e.g.
library crypto does currently not provide any predicates for private/public key generation.
I'd then suggest to add 2 new predicates in library crypto
e.g
%% crypto_private_key(+Algo, -PrivateKey, +Options) is nondet
% where PrivateKey is a random private key generated by openssl using algorithm Algo
% generates an infinite number of keys on backtracking
and
%% crypto_public_key(-PrivateKey, +PublicKey, +Options) is det
% where PublicKey is the public key associated with PrivateKey
For reference, see discussion in Curve25519 in library crypto
The text was updated successfully, but these errors were encountered: