A triplet of algorithms (Gen, Enc, Dec), a message spaceM, and a key space K, together is called a private-key encryption scheme if:
The key-generation algorithm, Gen is a randomized algorithm that returns a key, kβGen, such that kβK.
The encryption algorithm, Enc:KΓMβ{0,1}β is an algorithm that takes as input a key kβK and a plain-text mβM (the message), and outputs a cipher-text c=Enckβ(m)β{0,1}β
The decryption algorithm, KΓ{0,1}ββM is an algorithm that takes as input a key kβK and a cipher-text cβ{0,1}β, and output a plain-text mβM.
The scheme is correct; that is, decrypting a valid cipher-text should output the original plain text. Formally we require that for all mβM,kβK,Deckβ(Enckβ(m))=m
flowchart LR
subgraph Alice
direction LR
msg1[Message]-->ENC
end
ENC --jizberisz--> DEC
subgraph Bob
direction LR
DEC--> msg2[Message]
end
sk[SecretKey]
sk --> ENC
sk --> DEC
A message space M
A key space K
Algorithm triplet:
Gen
Alice and Bob first need to meet in advance to generate and agree on a secret keykβK
Secret keys are shared
A uses secret key to encrypte a message, becomes a cyber text,
A sends cyber message to B, B then decrypt using the agreed secret key
Enc
Alice has a private message mβM for Bob, she sends c=Enckβ(m) over the insecure channel.
Dec
Once Bob receives the cipher-text c, he decrypts it by running m=Deckβ(c) to read the original message