๐ŸŽ‰ ไปŽ330่ฝฌไธบWashUๅธฎๅŠฉๆ‰‹ๅ†Œๅ•ฆ!

CSE442
ๆจกๅ—
Cse442t L2

Lecture 2

Probability review

Sample space S=S= set of outcomes (possible results of experiments)

Event AโŠ†SA\subseteq S

P[A]=P[P[A]=P[ outcome xโˆˆA]x\in A]

P[{x}]=P(x)P[\{x\}]=P(x)

Conditional probability:

P[AโˆฃB]=P[AโˆฉB]P[B]P[A|B]={P[A\cap B]\over P[B]}

Assuming BB is the known information. Moreover, P[B]>0P[B]>0

Probability that AA and BB occurring: P[AโˆฉB]=P[AโˆฃB]โ‹…P[B]P[A\cap B]=P[A|B]\cdot P[B]

P[BโˆฉA]=P[BโˆฃA]โ‹…P[A]P[B\cap A]=P[B|A]\cdot P[A]

So P[AโˆฃB]=P[BโˆฃA]โ‹…P[A]P[B]P[A|B]={P[B|A]\cdot P[A]\over P[B]} (Bayes Theorem)

There is always a chance that random guess would be the password... Although really, really, low...

Law of total probability

Let S=โ‹ƒi=1nBiS=\bigcup_{i=1}^n B_i. and BiB_i are disjoint events.

A=โ‹ƒi=1nAโˆฉBiA=\bigcup_{i=1}^n A\cap B_i (AโˆฉBiA\cap B_i are all disjoint)

P[A]=โˆ‘i=1nP[AโˆฃBi]โ‹…P[Bi]P[A]=\sum^n_{i=1} P[A|B_i]\cdot P[B_i]

Back to cryptography

Defining security.

Perfect Secrecy (Shannon Secrecy)

Kโ†Gen()K\gets Gen() KโˆˆKK\in\mathcal{K}

cโ†EncK(m)c\gets Enc_K(m) or we can also write as cโ†Enc(K,m)c\gets Enc(K,m) for mโˆˆMm\in \mathcal{M}

And the decryption procedure:

mโ€ฒโ†DecK(cโ€ฒ)m'\gets Dec_K(c'), mโ€ฒm' might be null.

P[Kโ†Gen():DecK(EncK(m))=m]=1P[K\gets Gen(): Dec_K(Enc_K(m))=m]=1

Shannon Secrecy

Distribution DD over the message space M\mathcal{M}

P[Kโ†Gen;mโ†D:m=mโ€ฒโˆฃcโ†EncK(m)]=P[mโ†D:m=mโ€ฒ]P[K\gets Gen;m\gets D: m=m'|c\gets Enc_K(m)]=P[m\gets D: m=m']

Basically, we cannot gain any information from the encoded message.

Code shall not contain any information changing the distribution of expectation of message after viewing the code.

NO INFO GAINED

Perfect Secrecy

For any 2 messages, say m1,m2โˆˆMm_1,m_2\in \mathcal{M} and for any possible cipher cc,

P[Kโ†Gen:cโ†EncK(m1)]=P[Kโ†Gen():cโ†EncK(m2)]P[K\gets Gen:c\gets Enc_K(m_1)]=P[K\gets Gen():c\gets Enc_K(m_2)]

For a fixed cc, any message could be encrypted to that...

Theorem

Shannon secrecy is equivalent to perfect secrecy.

Proof:

If a crypto-system satisfy perfect secrecy, then it also satisfy Shannon secrecy.

Let (Gen,Enc,Dec)(Gen, Enc,Dec) be a perfectly secret crypto-system with K\mathcal{K} and M\mathcal{M}.

Let DD be any distribution over messages.

Let mโ€ฒโˆˆMm'\in \mathcal{M}.

=PK[cโ†EncK(mโ€ฒ)]โ‹…P[m=mโ€ฒ]PK,m[cโ†EncK(m)]={P_K[c\gets Enc_K(m')]\cdot P[m=m']\over P_{K,m}[c\gets Enc_K(m)]}\\ P[Kโ†Gen();mโ†D:m=mโ€ฒโˆฃcโ†EncK(m)]=PK,m[cโ†EncK(m)โˆฃm=mโ€ฒ]โ‹…P[m=mโ€ฒ]PK,m[cโ†EncK(m)]PK,m[cโ†EncK(m)]=โˆ‘i=1nPK,m[cโ†Enck(m)โˆฃm=mi]โ‹…P[m=mi]=โˆ‘i=1nPK,mi[cโ†Enck(mi)]โ‹…P[m=mi]P[K\gets Gen();m\gets D:m=m'|c\gets Enc_K(m)]={P_{K,m}[c\gets Enc_K(m)\vert m=m']\cdot P[m=m']\over P_{K,m}[c\gets Enc_K(m)]}\\ P_{K,m}[c\gets Enc_K(m)]=\sum^n_{i=1}P_{K,m}[c\gets Enc_k(m)|m=m_i]\cdot P[m=m_i]\\ =\sum^n_{i=1}P_{K,m_i}[c\gets Enc_k(m_i)]\cdot P[m=m_i]

and PK,mi[cโ†EncK(mi)]P_{K,m_i}[c\gets Enc_K(m_i)] is constant due to perfect secrecy

โˆ‘i=1nPK,mi[cโ†EncK(mi)]โ‹…P[m=mi]=โˆ‘i=1nP[m=mi]=1\sum^n_{i=1}P_{K,m_i}[c\gets Enc_K(m_i)]\cdot P[m=m_i]=\sum^n_{i=1} P[m=m_i]=1