14 November 2014


Quote from “Principles of Computer System Design: An Introduction”:

For both confidentiality and authentication, Alice first encrypts and then signs the encrypted message (i.e., SIGN(ENCRYPT(M , K_encrypt ), K_sign )), or, the other way around. (If good implementations of SIGN and VERIFY are used, it doesn’t matter for correctness in which order the operations are applied.)

A recent paper on the topic on the order of authentication and encrypting suggests that first encrypting and then computing an authentication tag may cover up certain weaknesses in some implementations of the encrypting primitives. Also, cryptographic transformations have been proposed that perform the transformation for encrypting and computing an authentication tag in a single pass over the message, saving time compared to first encrypting and then computing an authentication tag.





pkcs8 - PKCS#8 format private key conversion tool

cat ca.key | openssl pkcs8 -topk8 -nocrypt

openssl genrsa -out my-safe-directory/1024.key 1024

openssl req uses -config to specify configuration file. openssl x509 uses -extfile to add extentions.

Client-side Certificate Authentication with Nginx

Generate keys and certificates follow instructions in CLIENT-SIDE CERTIFICATE AUTHENTICATION WITH NGINX. Ngnix configuration:

ssl_client_certificate /home/jing/complete/ca.crt;
ssl_verify_client on;

Allow access to imported privateKey:

Keychain Access

http https://gce.ileci.com --cert user.crt --cert-key user.key works. When Enter PEM pass phrase: appears, import password for private key.

X509 Extension

  • Add extensions with openssl req: https://security.stackexchange.com/a/91556/183595
  • Add extensions with openssl x509: https://security.stackexchange.com/a/159537/183595

openssl x509 -req will only honor extension in x509 own configuration. It will omit extensions contained in the CSR.

Hostname Verification