# How to print encrypted text on the console?

**URL:** <https://openfhe.discourse.group/t/how-to-print-encrypted-text-on-the-console/325>\
**Category:** Library Questions\
**Created:** [January 30, 2023, 11:40am UTC](https://openfhe.discourse.group/t/how-to-print-encrypted-text-on-the-console/325 "2023-01-30T11:40:41Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![iquah](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/iquah/32/8_2.png) [@iquah](https://openfhe.discourse.group/u/iquah)\
**Post date:** [February 3, 2023, 2:24pm UTC](https://openfhe.discourse.group/t/how-to-print-encrypted-text-on-the-console/325/7 "2023-02-03T14:24:18Z")

</div>

@jtovartr There’s a bit of nuance here that might go over your head (especially as a newbie). Say we have the following dataset:

```auto
X = [
    [0, 1, 2, 3],
    [4, 5, 6, 7],
    [8, 9, 10, 11],
    [12, 13, 14, 15],
    [16, 17, 18, 19]
])

```

Two things to keep in mind:

1. Oftentimes, we have more rows than columns in the dataset.
2. Encryption is **slow**.

So, instead of encrypting row-by-row, we encrypt column-wise. So, we might have something like the following (think of this as a transpose and then an encrypt):

```auto
encX = [
       enc([0, 4, 8, 12, 16, 0,0,...0]),
       enc([1, 5, 9, 13, 17, 0,0,...0]),
       enc([2, 6, 10, 14, 18, 0,0,...0])),
       enc([3, 7, 11, 15, 19, 0,0,...0])
]

```

in general, the number of generated ciphertexts is the number of features that we have. One question you may have is “Where did those extra 0’s come from?” and the answer is that it’s for the sake of security. These extra 0’s are part of what makes these ciphertexts so large. Depending on your security parameters, each ciphertext can come up to storing `131_072` integers at once. Depending on your use-case that might be acceptable but I think it depends.

# Extra Details

Want to know what other things affect your ciphertext size?

> [@How to reduce the size of ckks ciphertext？](https://openfhe.discourse.group/t/how-to-reduce-the-size-of-ckks-ciphertext/290/2):
>
> Ciphertext expansion is a known cost with FHE. There are various research level approaches to reduce ciphertext but I think you are talking about what you can do right now. First, ciphertext size in CKKS are driven by three main things: native word size, ringsize, and multiplicative depth. these are ususally determined by the parameters selected when building the crypto context, and we recommend using one of the standard settings based on your security requirements. You already fixed your de…

HTH!

---

_[View the full topic](https://openfhe.discourse.group/t/how-to-print-encrypted-text-on-the-console/325)._
