# DeserializeCiphertext from a byte string in memory in OpenFHE-Python

**URL:** <https://openfhe.discourse.group/t/deserializeciphertext-from-a-byte-string-in-memory-in-openfhe-python/2099>\
**Category:** OpenFHE ports/wrappers\
**Created:** [July 16, 2025, 3:42pm UTC](https://openfhe.discourse.group/t/deserializeciphertext-from-a-byte-string-in-memory-in-openfhe-python/2099 "2025-07-16T15:42:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![colomr32](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@colomr32](https://openfhe.discourse.group/u/colomr32)\
**Post date:** [July 16, 2025, 3:42pm UTC](https://openfhe.discourse.group/t/deserializeciphertext-from-a-byte-string-in-memory-in-openfhe-python/2099/1 "2025-07-16T15:42:27Z")

</div>

Hi,

I’m using OpenFHE with the BFV scheme in Python. I serialize a ciphertext with `Serialize(ct, BINARY)`, send it over the network as base64, then decode it back to bytes.

Is there a way to call `DeserializeCiphertext()` with a byte string directly? The function seems to only accept a file path.

Thanks!

---

<div class="post-metadata">

**Author:** ![g\_tasop](https://avatars.discourse-cdn.com/v4/letter/g/258eb7/32.png) [@g\_tasop](https://openfhe.discourse.group/u/g_tasop)\
**Post date:** [July 18, 2025, 12:34pm UTC](https://openfhe.discourse.group/t/deserializeciphertext-from-a-byte-string-in-memory-in-openfhe-python/2099/2 "2025-07-18T12:34:02Z")

</div>

Yes you can use this function:

```python
DeserializeCiphertextString(serialized_ciph, BINARY)

```

Event though this is not present in the documentation, you can check its usage in this file [here](https://github.com/openfheorg/openfhe-python/blob/07a81b4bf1d84aa96a70de31dadce2d0ae19591c/tests/test_serial_cc.py#L138)

---

<div class="post-metadata">

**Author:** ![colomr32](https://avatars.discourse-cdn.com/v4/letter/c/ecccb3/32.png) [@colomr32](https://openfhe.discourse.group/u/colomr32)\
**Post date:** [July 22, 2025, 8:49am UTC](https://openfhe.discourse.group/t/deserializeciphertext-from-a-byte-string-in-memory-in-openfhe-python/2099/3 "2025-07-22T08:49:33Z")

</div>

Thank you very much!
