decrypt :: PrivateKey -> Encrypted -> IO BS.ByteString
decrypt privateKey encrypted =

  let encKey      = key    encrypted
      inputVector = iv     encrypted
      input       = output encrypted

      unpad :: BS.ByteString -> BS.ByteString
      unpad = Pad.unpadPKCS5

  in do
    cipher <- getCipher
    (return . unpad) (Open.openBS cipher encKey inputVector privateKey input)
decrypt :: PrivateKey -> Encrypted -> IO BS.ByteString
decrypt privateKey encrypted =

  let encKey      = key    encrypted
      inputVector = iv     encrypted
      input       = output encrypted

      unpad :: BS.ByteString -> BS.ByteString
      unpad = Pad.unpadPKCS5

  in do
    cipher <- getCipher
    (return . unpad) (Open.openBS cipher encKey inputVector privateKey input)
decrypt privateKey encrypted =

  let encKey      = key    encrypted
      inputVector = iv     encrypted
      input       = output encrypted

      unpad :: BS.ByteString -> BS.ByteString
      unpad = Pad.unpadPKCS5

  in do
    cipher <- getCipher
    (return . unpad) (Open.openBS cipher encKey inputVector privateKey input)