--- title: "symmetric encryption()" slug: "basic-symmetric-encryption" updated: 2026-08-12T13:13:37Z published: 2026-08-12T13:13:37Z canonical: "docs.lobstersoftware.com/basic-symmetric-encryption" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # symmetric encryption() This function encrypts a text **a** with charset **d**, using the hex-encoded symmetric key **c** and algorithm **b**. The result is the encrypted data, see also parameter **f**. If an initial vector is needed for the encryption algorithm, it can be provided as hex-encoded text with **e**. ## Parameters | Parameter | Description | | --- | --- | | a | Text to be encrypted. | | b | (optional) Encryption algorithm. Default: *AES.* **NOTE:** Use the three dots to select a value. If no mode and padding are specified, the JVM default will be used, which might change in a future version. The specification of the complete algorithm is suggested. | | c | Key as hex-encoded text. | | d | (optional) Charset used for the conversion from text **a** to binary data. Default: *8859_1.* **NOTE:** Use the three dots to select a value. | | e | (optional) Initial vector as hex-encoded text. | | f | (optional) The format of the return value. Allowed values: *hex*, *base64*, *raw*. Default: *hex* | ## Examples | Parameter a | b | c | d | e | f | Result | | --- | --- | --- | --- | --- | --- | --- | | täst€ | | 010203040506070809000a0b0c0d0e0f | | | | 5720cacf806b4feccfd1d4baf7b4e036 | | täst€ | | 010203040506070809000a0b0c0d0e0f | uft8 | | | bfa536255e3055e5c3342eebb509eee3 | | täst€ | AES/ECB/PKCS5Padding | 010203040506070809000a0b0c0d0e0f | uft8 | | | bfa536255e3055e5c3342eebb509eee3 | | täst€ | DESEDE/ECB/PKCS5Padding | 010203040506070809000a0b0c0d0e0f | 8859_15 | | | 64f2e3f139eb65be | ## Related - [symmetric decryption()](/basic-symmetric-decryption.md)