Learn > Browser plugins (plugin.js) > The api object API.CRYPTO(OP, FIELDS) All binary values are base64, each at most 64 KB. Errors come back as {error} with HTTP 200, so check for error. - random Fields: len (<= 4096, default 16) Returns: data - sha1 / sha256 Fields: data Returns: data - aesenc Fields: key, iv (16 bytes each), data Returns: data (AES-128-CBC, PKCS#7) - aesdec Fields: key, iv, data Returns: data (padding NOT removed) - keygen Fields: none Returns: public (SPKI DER), private (PKCS#8 DER) - pubencrypt Fields: cert (X.509 DER), data Returns: data - sign Fields: private, hash (20 bytes) Returns: data (128-byte raw RSA) - rsadec Fields: private, data Returns: data (raw, padding left) - pkcs12 Fields: data, password Returns: key, cert Watch out for crypto.subtle. Browsers only provide crypto.subtle (HMAC, SHA-256, AES-GCM...) in a secure context (HTTPS or localhost). The reader's web UI is plain http://crosspoint.local or http://192.168.x.x, so crypto.subtle is usually undefined there. crypto.getRandomValues still works. For hashing or signing, use api.crypto or a small pure-JS library you ship in your plugin folder (for example a SHA-1/HMAC implementation for OAuth 1.0a). The official docs suggest crypto.subtle. Test it on a real device before relying on it. End of this folder.