# Use CipherText properties in Functions and Actions :::callout{theme="warning"} Use of Cipher in Functions requires an [Operational User License](../getting-started/index.md#operational-user-license). If [checkpoints](../../checkpoints/overview/index.md) are configured for this operation (hashing, encrypting, decrypting), the license must be allowed to [bypass checkpoints](../getting-started/index.md#bypass-checkpoints). ::: Functions code repositories can be used to interact with CipherText object properties, enabling sophisticated logic like bulk encryption or bulk decryption. To get started with Functions, see [this tutorial](../../action-types/function-actions-getting-started/index.md). For the examples below assume we have an `EncryptedCustomer` object with the following properties: * An encrypted CipherText `name` * A unique, unencrypted integer `id` We will be writing two functions to interact with this object: * `decryptEncryptedCustomer()` will take in an `EncryptedCustomer` object and return the plaintext name. * `updateEncryptedName()` will take in an `EncryptedCustomer` object and a `newName` and update the encrypted name of that object to the `newName`. ![Type\_Classes](../../../assets/4fcee0dab04220c43eb33c7f284d85a6760695620cce92e49ddfa56a3629dad3.webp) ## Decrypting CipherText Properties in Functions In this example we decrypt and return the `name` property of an `EncryptedCustomer` object. ```typescript import { Function, Integer, OntologyEditFunction, Edits } from "@foundry/functions-api"; import { Objects, EncryptedCustomers } from "@foundry/ontology-api"; @Function() public async decryptEncryptedCustomer(customer: EncryptedCustomers): Promise { return await customer.name?.decryptAsync(); } ``` ## Updating CipherText Properties in Functions In the example below, we update the `name` property of an `EncryptedCustomer` object. Like [any function that updates objects](../../functions/api-ontology-edits/index.md), this function must be annotated with `@OntologyEditFunction()` and `@Edits(EncryptedCustomers)`. Running this function in preview will not actually edit the object. ```typescript import { Function, Integer, OntologyEditFunction, Edits } from "@foundry/functions-api"; import { Objects, EncryptedCustomers } from "@foundry/ontology-api"; @OntologyEditFunction() @Edits(EncryptedCustomers) public async updateEncryptedName(customer: EncryptedCustomers, newName: string): Promise { await customer.name?.updateAsync(newName); } ```