> For the complete documentation index, see [llms.txt](https://dibs.gitbook.io/vortex-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dibs.gitbook.io/vortex-docs/standard-modules/crypto.md).

# Crypto

The 'crypto' module provides encryption/decryption functionality using OpenSSL

### Function Signatures

{% code overflow="wrap" %}

```go
// Object containing functions related to EVP (Envelope)
const evp = {
    // Generates a key of specified size (default: 32)
    generate_key: (size: Number = 32) => String,
    // Encrypts a string using the provided key
    encrypt: (str: String, key: String) => String,
    // Decrypts a string using the provided key
    decrypt: (str: String, key: String) => String,
}

// Object containing functions related to RSA (Rivest–Shamir–Adleman)
const rsa = {
    // Generates a pair of RSA keys of specified size (default: 2048)
    generate_pair: (size: Number = 2048) => {
        private: String,
        public: String
    },
    // Encrypts a string using the provided RSA key
    encrypt: (str: String, key: String) => String,
    // Decrypts a string using the provided RSA key
    decrypt: (str: String, key: String) => String,
}
```

{% endcode %}
