anchor.diff:  | SHA3                 | 256, 384, 512
   | MD5                  | 128
   | Tiger                | 192
  +| Blake2b              | 512
  +| Skein                | 256, 512, 1024, arbitrary size
   |===============================================
   
   
  
positive.code: 
  == Digital Signatures
  
  Digital Signatures differ from Mac as Mac values are both generated
  and verified using the same secret key. Digital Signatures require a
  public/private keypair. It signs using a private key and verifies a
  signature using a public key.
  
  
  === RSASSA PSS
  
  RSASSA-PSS is an improved probabilistic signature scheme with
  appendix. What that means is that you can use a private RSA key
  to sign data in combination with some random input.
  
  RFC: http://www.ietf.org/rfc/rfc3447.txt
  
  .Sign sample string using rsassa-pss.
  [source, clojure]
  ----
  (require '[buddy.core.keys :as keys])
  (require '[buddy.core.sign.rsapss :as rsapss])
  
  ;; Read private key
  (def rsaprivkey (keys/private-key "test/_files/privkey.3des.rsa.pem" "secret"))
  
  ;; Make signature
  (def signature (rsapss/sign "foo" rsaprivkey :sha256))
  
  ;; Now signature contains a byte[] with signature of "foo" string
  ----
  
  .Verify signature using rsassa-pss.
  [source, clojure]
  ----
  ;; Read private key
  (def rsapubkey (keys/private-key "test/_files/pubkey.3des.rsa.pem"))
  
  ;; Make verification
  (rsapss/verify "foo" signature rsapubkey :sha256))
  ;; => true
  ----
  
  
  === RSASSA PKCS1 v1.5
  
  RSASSA-PSS is an probabilistic signature scheme with appendix.
  What that means is that you can use a private RSA key to sign data.
  
  RFC: http://www.ietf.org/rfc/rfc3447.txt
  
  
  .Sign sample string using rsassa-pkcs.
  [source, clojure]
  ----
  (require '[buddy.core.keys :as keys])
  (require '[buddy.core.sign.rsapkcs :as rsapkcs])
  
  ;; Read private key
  (def rsaprivkey (keys/private-key "test/_files/privkey.3des.rsa.pem" "secret"))
  
  ;; Make signature
  (def signature (rsapkcs/sign "foo" rsaprivkey :sha256))
  
  ;; Now signature contains a byte[] with signature of "foo" string
  ----
  
  .Verify signature using rsassa-pkcs.
  [source, clojure]
  ----
  ;; Read private key
  (def rsapubkey (keys/private-key "test/_files/pubkey.3des.rsa.pem"))
  
  ;; Make verification
  (rsapkcs/verify "foo" signature rsapubkey :sha256))
  ;; => true
  ----
  
  
  === Eliptic Curve DSA
  
  Elliptic Curve Digital Signature Algorithm (ECDSA) is a variant of the
  Digital Signature Algorithm (DSA) which uses elliptic curve cryptography.
  
  .Sign sample string using ecdsa.
  [source, clojure]
  ----
  (require '[buddy.core.keys :as keys])
  (require '[buddy.core.sign.ecdsa :as ecdsa])
  
  ;; Read private key
  (def ecdsaprivkey (keys/private-key "test/_files/privkey.ecdsa.pem" "secret"))
  
  ;; Make signature
  (def signature (ecdsa/sign "foo" ecdsaprivkey :sha256))
  ----
  
  .Verify signature using ecdsa.
  [source, clojure]
  ----
  ;; Read private key
  (def ecdsapubkey (keys/private-key "test/_files/pubkey.ecdsa.pem"))
  
  ;; Make verification
  (ecdsa/verify "foo" signature ecdsapubkey :sha256))
  ;; => true
  ----
  
  
  == Key Derivation Functions
  
  Key derivation functions are often used in conjunction with non-secret parameters
  to derive one or more keys from a common secret value.
  
negative.code: = buddy-core - Cryptographic Api
  Andrey Antukh, <niwi@niwi.nz>
  0.8.0
  :toc: left
  :!numbered:
  :source-highlighter: pygments
  