# What do $0^n$ and $1^n$ mean in cryptography?

EDIT : I added more context.

Let $f$ = {$f_k$} be a pseudo random function family.

Let $G(x)$ be a pseudo-random generator such that: $G(x)$ = $f_x$($0^k$)$f_x$($1^k$) where k=$|x|$ .

I don't understand the meaning of $1^n$ , $0^n$ and the differences between them within that context. What do they represent?

What is the special role / affect they have on the above context? and how?

Why $1^n$ , $0^n$ and not other combinations?

-

## 3 Answers

Without seeing the entire formal construction: It seems like they wanted different strings. Meaning they needed $f_x(a)||f_x(b)$ where $a≠b$. The easiest way to express this is using the all $0$ and all $1$ strings, but any other pair of distinct strings of that length would yield the same effect.

As to why they wanted this: They're using a PRF twice to construct a PRG. Consider what would happen if they used the same string both times. You'd get $$G(x)=f_x(0^k)||f_x(0^k)$$

And the output string would have the property that the first half of the bits are same as the second half of the bits and this would not be pseudorandom(a distinguisher can just check if the the first half and second half of the bits are the same), so $G$ would definitely not be a PRG.

-

Typically that means a string of either $n$ zeros or $n$ ones.

-
yeah but what is the meaning of those strings inside the above equation? why $0^k$ and not $0^{k-1}$1 ? – Yoni Hassin Dec 28 '12 at 23:34
Why always in cryptography $1^k$ and $0^k$ are used? do they have a symbolic value? that the part that confuses me. – Yoni Hassin Dec 28 '12 at 23:40
@YoniHassin: what are you actually asking? What $0^k$ means, or why that was selected rather than $0^{k-1}1$? As for the former, it (in context) means a bitstring consisting of k zero bits. As for the latter, well, the reason the author of the primitive selected that specific choice probably depends a lot on the context of how the primitive works; without knowing the context, it is unlikely anyone could guess. – poncho Dec 29 '12 at 3:49
I will try to rewrite the question so it will be more clear. – Yoni Hassin Dec 29 '12 at 3:57

1
In light of the above edit, it seems like they wanted different strings. Meaning they needed $f_x(a)||f_x(b)$ where $a \neq b$. The easiest way to express this is using the all 0 and all 1 strings, but any other unique pair would yield the same effect. – AFS Dec 29 '12 at 23:04
show 1 more comment

$0^n$ means a string of $n$ zeros (the $n$-bit string that is all zeros). $1^n$ means a string of $n$ ones.

Why were these used? There's nothing special about $0^n$ or $1^n$, in this context. They could have used any pair of two constant $n$-bit strings, as long as the two strings were not the same. $0^n$ and $1^n$ is a convenient choice of two strings that are different, but they could have chosen any other pair (as long as they're not both the same) and that would have worked fine, too.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 40, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9617952108383179, "perplexity_flag": "head"}