---
name: "Eet_File_Cipher_Group"
section: "3"
platform: "linux"
package: "libeet-doc"
version: "1.3.2-1"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/Eet_File_Cipher_Group"
---

# Eet\_File\_Cipher\_Group(3)

Most of the Eet File Main Functions have alternative versions that accounts for ciphers to protect their content.

## NAME

Eet File Ciphered Main Functions -

Most of the **Eet File Main Functions** have alternative versions that accounts for ciphers to protect their content.

### Functions

EAPI void \* **eet\_read\_cipher** (**Eet\_File** \*ef, const char \*name, int \*size\_ret, const char \*cipher\_key)\
 *Read a specified entry from an eet file and return data using a cipher.*  EAPI int **eet\_write\_cipher** (**Eet\_File** \*ef, const char \*name, const void \*data, int size, int compress, const char \*cipher\_key)\
 *Write a specified entry to an eet file handle using a cipher.*

## Detailed Description

Most of the **Eet File Main Functions** have alternative versions that accounts for ciphers to protect their content.

**See also:**

**Cipher, Identity and Protection Mechanisms**

## Function Documentation

### EAPI void\* eet\_read\_cipher (Eet\_File \* ef, const char \* name, int \* size\_ret, const char \* cipher\_key)

Read a specified entry from an eet file and return data using a cipher. **Parameters:**

*ef* A valid eet file handle opened for reading. \
 *name* Name of the entry. eg: '/base/file\_i\_want'. \
 *size\_ret* Number of bytes read from entry and returned. \
 *cipher\_key* The key to use as cipher.

**Returns:**

The data stored in that entry in the eet file.

This function finds an entry in the eet file that is stored under the name specified, and returns that data, decompressed, if successful. NULL is returned if the lookup fails or if memory errors are encountered. It is the job of the calling program to call free() on the returned data. The number of bytes in the returned data chunk are placed in size\_ret.

If the eet file handle is not valid NULL is returned and size\_ret is filled with 0.

**See also:**

**eet\_read()**

**Since:**

1\.0.0

References EET\_FILE\_MODE\_READ, and EET\_FILE\_MODE\_READ\_WRITE.

Referenced by eet\_data\_dump\_cipher(), eet\_data\_image\_header\_read\_cipher(), eet\_data\_image\_read\_cipher(), eet\_data\_image\_read\_to\_surface\_cipher(), eet\_data\_node\_read\_cipher(), eet\_data\_read\_cipher(), and eet\_read().

### EAPI int eet\_write\_cipher (Eet\_File \* ef, const char \* name, const void \* data, int size, int compress, const char \* cipher\_key)

Write a specified entry to an eet file handle using a cipher. **Parameters:**

*ef* A valid eet file handle opened for writing. \
 *name* Name of the entry. eg: '/base/file\_i\_want'. \
 *data* Pointer to the data to be stored. \
 *size* Length in bytes in the data to be stored. \
 *compress* Compression flags (1 == compress, 0 = don't compress). \
 *cipher\_key* The key to use as cipher.

**Returns:**

bytes written on successful write, 0 on failure.

This function will write the specified chunk of data to the eet file and return greater than 0 on success. 0 will be returned on failure.

The eet file handle must be a valid file handle for an eet file opened for writing. If it is not, 0 will be returned and no action will be performed.

Name, and data must not be NULL, and size must be \> 0. If these conditions are not met, 0 will be returned.

The data will be copied (and optionally compressed) in ram, pending a flush to disk (it will stay in ram till the eet file handle is closed though).

**See also:**

**eet\_write()**

**Since:**

1\.0.0

References EET\_FILE\_MODE\_READ\_WRITE, and EET\_FILE\_MODE\_WRITE.

Referenced by eet\_data\_image\_write\_cipher(), eet\_data\_node\_write\_cipher(), eet\_data\_undump\_cipher(), eet\_data\_write\_cipher(), and eet\_write().

## Author

Generated automatically by Doxygen for Eet from the source code.
