随机算法

Randomized Algorithm.

A randomized algorithm uses a source of (pseudo) randomness as part of its logic.

Randomized algorithm, as opposed to deterministic algorithm, mapping the same input to several random outputs. The randomness is guaranteed by some random tapes implemented by TRNGs, PRGs, PRFs or PRPs.

Randomized algorithms are essential to build secure cryptographic primitives: in particular, Any CPA-secure encryption scheme must be randomized.

Chosen-plaintext attack (CPA): Adversary holds the encryption oracle Enck(⋅)Enc_k(\cdot), which means he is able to obtain any ciphertext cc for a desired message mm without knowing secret key kk.

For a deterministic encryption scheme, there is a trivial CPA adversary A\mathscr{A}: A\mathscr{A} ask Enck(⋅)Enc_k(\cdot) to encrypt m0,m1m_0,m_1 first and obtain c0=Enck(m0),c1=Enck(m1)c_0=Enc_k(m_0), c_1=Enc_k(m_1). Then when it gets challenge ciphertext cc, A\mathscr{A} simply compares cc to c0,c1c_0,c_1. If c=c0c=c_0, output 00, and if c=c1c=c_1, output 11.

Also we could see that, for public encryption scheme, EAV-security is equivalent to CPA-security since adversary knows public key pkpk. (equivalent to hold the encryption oracle Encpk(⋅)Enc_{pk}(\cdot))