1
0

README.openssl 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. IMPORTANT
  2. =========
  3. 1. Do not use any of the OpenSSL binaries
  4. 2. Do not compile OpenSSL binaries yourself
  5. (except for doing some research into the deep internals of OpenSSL)
  6. REASONS
  7. =======
  8. All OpenSSL binaries included are highly experimental and are likely to fail
  9. in many cases. To get some real benefit from OpenSSL (or PolarSSL) it should
  10. handle all crypting/hashing.
  11. However this is not possible because Microsoft has slightly altered AES
  12. encryption in KMSv6 and uses a non-AES variant of the Rijndael CMAC in
  13. KMSv4. OpenSSL is not able to handle this if you use it correctly.
  14. This means OpenSSL can be used safely only for SHA256 and HMAC SHA256
  15. calculations used in KMSv5 and KMSv6 but the code size benefit is only
  16. 100 to 300 bytes (depending on the architecture).
  17. To benefit more from OpenSSL (getting it performing the AES stuff) I do
  18. the first phase of AES encryption/decryption (called key expansion) with my
  19. own code. I then poke the expanded key into internal OpenSSL structs to make
  20. it behave in a way not intended by the OpenSSL developers but in a way to
  21. perform non-standard AES crypting as required by KMSv4 and KMSv6. KMSv5 is
  22. the only protocol that could use OpenSSL without hacking the OpenSSL internals.
  23. That means vlmcsd still needs about 40% of the internal AES code plus some
  24. OpenSSL hacking code to poke the expanded key into OpenSSL.
  25. The entire OpenSSL hacking does not work in every case because the internal
  26. OpenSSL structs differ depending on the OpenSSL version, OpenSSL configuration
  27. at compile time (whether it is configured to use compiled C code or assembler
  28. code), CPU architecture and CPU features (whether it can perform AES in
  29. hardware).
  30. SUMMARY
  31. =======
  32. If you use OpenSSL in a safe way (compile with CRYPTO=openssl), there is not
  33. much benefit from it. The binary may become bigger or smaller and you
  34. definitely need more RAM when you run vlmcsd or vlmcs.
  35. If you use hacked OpenSSL (compile with CRYPTO=openssl_with_aes or
  36. CRYPTO=openssl_with_aes_soft) you risk malfunction of vlmcs/vlmcsd even if it
  37. performed correctly several times before.
  38. Both vlmcs and vlmcsd do not have more features when compiled with OpenSSL
  39. support. It may be faster (especially on CPUs with hardware assisted AES) but
  40. uses more memory and may fail or perform unreliably.