Skip to content
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

How to build a custom PQCrypto-VPN with latest (dev) liboqs and OQS-OpenSSL (1.1.1k) on Windows 10 #28

Closed
pqfan opened this issue Nov 27, 2020 · 4 comments
Labels
wontfix This will not be worked on

Comments

@pqfan
Copy link

pqfan commented Nov 27, 2020

My building system's basic details:
O.S.: Windows 10 Home Edition

CPU: AMD-type

CMD Prompt: Using Administrator x64 Native tools command prompt of VS 2019

Stage: all tests passed, oqs-openssl and libs installed correctly and working

Here is a quick guide on how to achieve it:

1. Build the repository of Microsoft PQCrypto-VPN as it currently is resulting is the windows binary and install it.

2. Install all the according Windows dependencies (git, VS 2019, Perl - Active & Strawberry - MinGW & MSys, other needed extensions like Ninja, NASM e.t.c. - check the liboqs and openssl-oqs repo) and clone the latest (dev versions) of liboqs and openssl-oqs from the gits.

3. After cloning, when in \liboqs\build use:
cmake -GNinja -DCMAKE_INSTALL_PREFIX=..\..\openssl-oqs\oqs -DBUILD_SHARED_LIBS=OFF ..
then ninja and ninja install should work just fine

4. build normally according to the instructions (perl Configure VC-WIN64A, then nmake test, then nmake install)

5. Import (copy) the libraries from the newly install Program Files\OpenSSL directory (under C:) to the openvpn\bin directory
You should also copy the newly created openssl.exe (binary) from \Program Files\OpenSSL\bin to \OpenVPN\bin aswell. It works but the system may need to be restarted.

**6. Don't forget to set the according PATH variables

7. Test the new algorithms
You can also activate other desired OQS algorithms than the default enabled ones. Follow this guide of the openssl-oqs folder on an Ubuntu machine and the download the updated archive/directory to your Windows system, re-install liboqs as explained above targeting this new directory and then perl Configure... , nmake... and you should be ready!

I wish you find my guide useful.

Best regards!

@pqfan pqfan changed the title How to build a custom PQCrypto-VPN with latest (dev) liboqs and OQS OpenSSL on Windows 10 How to build a custom PQCrypto-VPN with latest (dev) liboqs and OQS OpenSSL (1.1.1h) on Windows 10 Nov 28, 2020
@pqfan
Copy link
Author

pqfan commented Apr 14, 2021

Greetings all,

Some updates regarding my quick guide:
Taking into consideration that all of OpenSSL, OQS-OpenSSL and libOQS have changed since then (liboqs now turns into 0.5.0 and openssl is regularly updated, having many fixes since my initial post) I would like to note the following observations and propose some quicker ways to do test the latest algorithms on Windows 10 (Pro - co_release in my case)

For the step 1.
You can just download Kevin's PQCrypto-VPN Windows binary from the "Releases page of this repository"
But when building on a Linux (Ubuntu) server, keep in my to replace the repos that are cloned with the ones you would like to test (meaning the latest repos as found on the OQS project according git repositorie sites)

For the step 3.
Replace the previously suggested command with the intended/standard one
( cmake -GNinja -DCMAKE_INSTALL_PREFIX=..\..\openssl-oqs\oqs .. )

For the step 5.
You should copy and replace all of the library files and the binary built with those found in the openvpn\bin directory

Some algorithms such as sidhp e.t.c. are currently now working/enabled on the latest Windows build, so you may need to:

  1. Build an initial Ubuntu package with the PQCrypto-VPN script (after replacing with the latest liboqs & openssl-oqs repos)
  2. Apply the recommendations for enabling custom algorithms on Ubuntu first, as found in the project Wiki (use the link found in the original post)
  3. Move and build the "patched" repos on a Windows machine using this guide

I will try to apply this last recommendation myself aswell and share my future insights.

Congratulations to all the involved people and contributors of the OpenSSL, PQCrypto-VPN, OQS-OpenSSL, libOQS sub-projects for all this great work!

@pqfan pqfan changed the title How to build a custom PQCrypto-VPN with latest (dev) liboqs and OQS OpenSSL (1.1.1h) on Windows 10 How to build a custom PQCrypto-VPN with latest (dev) liboqs and OQS-OpenSSL (1.1.1k) on Windows 10 Apr 14, 2021
@kevinmkane
Copy link
Member

Thank you for your continued interest! As you see we haven't had the resources available to update this project yet, but I'm keeping your issues open so that we have them as a reference when we're able.

And of course, we always take pull requests, so if you have the time and motivation to make any of the changes yourself, we'd be glad to take them!

@pqfan
Copy link
Author

pqfan commented Apr 14, 2021

Greetings Kev,

Yes I would be more than happy to provide some contribution on the PQCrypto-VPN sub-project of OQS, possibly by providing a frequently upgraded branch of all the according repos involved, so I have already started working on it and I will provide you with details pretty soon, maybe within a few days

Also I have to state that in the Windows build, all PQ KEMs are enabled but in HYBRID mode, except NTRU-Prime which is also allowed to be used in normal PQ mode.

That means:
If is any of the algorithms listed above, the following hybrid algorithms are supported:

if <KEX> has L1 security, the fork provides the method p256_<KEX>, which combine <KEX> with ECDH using the P256 curve.
if <KEX> has L3 security, the fork provides the method p384_<KEX>, which combines <KEX> with ECDH using the P384 curve.
if <KEX> has L5 security, the fork provides the method p521_<KEX>, which combines <KEX> with ECDH using the P521 curve.

For example, since kyber768 claims L3 security, the hybrid p384_kyber768 is available.

(these datasheets specify which provide what security)

@pqfan
Copy link
Author

pqfan commented Apr 15, 2021

Two very last notes for now, I would like to comment, coming from my tests so far, are that:

A. actually every pure PQ KEM algorithm originally enabled in OQS-OpenSSL and libOQS can be used using my guide above, but you have to:

  1. Pick KEMs in hybrid-cryptography mode as written in the previous post
  2. Pick any enabled pure OQS signature algorithm for the public key signature, and not any among those that are available from the fork for the hybrid-cryptography mode.
    If my assumptions are correct, that way the key exchange that is initialized in hybrid-cryptography mode, results in pure PQ exchange. by using only PQ certs/keys

B. The second one is that if the desired algorithm falls in NIST L4 security, you can use it as either secp384_ or secp521_ (I don't remember now which one worked for me, actually)

Best regards and enjoy the NIST Round 3 submissions!

@kevinmkane kevinmkane added the wontfix This will not be worked on label Apr 6, 2023
@kevinmkane kevinmkane closed this as not planned Won't fix, can't repro, duplicate, stale Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants