# Encrypt Data Example

> See how to securely encrypt data using API Maker’s system API with a working example.

Source: https://docs.apimaker.dev/v1/examples/sys/system/encrypt.html

`g.sys.system.encrypt` calls the [encrypt data system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-encrypt-data-api.html) from your code, whatever the settings of that API say about HTTP callers.

### Encrypt System API

Get encrypted data using global object 'g'.
```ts
let encryptedData = await g.sys.system.encrypt({
    "data": {
        "name": "Bob"
    }
});
```

## Related

- [Encrypt data system API](https://docs.apimaker.dev/v1/docs/apis-all/system-apis/system-generated-encrypt-data-api.html) · [All system APIs from code](https://docs.apimaker.dev/v1/examples/sys/system/system.html) · [The global object g](https://docs.apimaker.dev/v1/docs/pre-defined-terms/global-object-g.html)
