Skip to content

Commit 79d5637

Browse files
committed
Changes in preparation for HACS
1 parent 47aa184 commit 79d5637

16 files changed

Lines changed: 327 additions & 3 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ _site/
1313
# Ignore folders generated by Bundler
1414
.bundle/
1515
vendor/
16+
17+
**/.DS_Store

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ gem "jekyll", "~> 4.3.3" # installed by `gem jekyll`
55

66
gem "just-the-docs", "0.8.1" # pinned to the current release
77
# gem "just-the-docs" # always download the latest release
8+
9+
group :jekyll_plugins do
10+
gem 'jekyll-katex'
11+
end

Gemfile.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ GEM
99
eventmachine (>= 0.12.9)
1010
http_parser.rb (~> 0)
1111
eventmachine (1.2.7)
12+
execjs (2.9.1)
1213
ffi (1.16.3)
1314
forwardable-extended (2.6.0)
1415
google-protobuf (3.25.3-arm64-darwin)
@@ -34,6 +35,9 @@ GEM
3435
webrick (~> 1.7)
3536
jekyll-include-cache (0.2.1)
3637
jekyll (>= 3.7, < 5.0)
38+
jekyll-katex (1.0.0)
39+
execjs (~> 2.7)
40+
jekyll (>= 3.6, < 5.0)
3741
jekyll-sass-converter (3.0.0)
3842
sass-embedded (~> 1.54)
3943
jekyll-seo-tag (2.8.0)
@@ -80,6 +84,7 @@ PLATFORMS
8084
DEPENDENCIES
8185
jekyll (~> 4.3.3)
8286
just-the-docs (= 0.8.1)
87+
jekyll-katex
8388

8489
BUNDLED WITH
8590
2.3.26

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ url: https://just-the-docs.github.io
66

77
aux_links:
88
ProofFrog Hub: https://github.com/ProofFrog
9+
10+
plugins:
11+
- jekyll-katex

_includes/head_custom.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">

assets/diagram.png

581 KB
Loading

examples.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: Examples
3+
layout: default
4+
---
5+
6+
# Examples
7+
8+
Below are a list of examples that ProofFrog can currently verify.
9+
Many are adapted from [The Joy of Cryptography](https://joyofcryptography.com/).
10+
In such cases, we will indicate which claim in the textbook is being proved.
11+
12+
## One-Time Uniform Ciphertexts implies One-Time Secrecy
13+
14+
This proves [Theorem 2.15](https://joyofcryptography.com/pdf/book.pdf#page=49).
15+
16+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/OTUC%3D%3EOTS.proof).
17+
18+
## CPA$ Security implies CPA Security
19+
20+
This proves [Claim 7.3](https://joyofcryptography.com/pdf/book.pdf#page=145)
21+
22+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/CPA%24%3D%3ECPA.proof).
23+
24+
## Composing Two Symmetric Encryption Schemes for One-Time Uniform Ciphertexts
25+
26+
This proof analyzes a symmetric encryption scheme {% katex %}\Sigma{% endkatex %} that composes two symmetric encryption schemes {% katex %}S{% endkatex %} and {% katex %}T{% endkatex %} where {% katex %}S.C = T.M{% endkatex %}, and
27+
{% katex display %}
28+
\Sigma.\mathrm{KeyGen}() = (S.\mathrm{KeyGen()}, T.\mathrm{KeyGen()})
29+
{% endkatex %}
30+
{% katex display %}
31+
\Sigma.\mathrm{Enc}((k_S, k_T), m) = T.\mathrm{Enc}(k_T, S.\mathrm{Enc}(k_S, m))
32+
{% endkatex %}
33+
{% katex display %}
34+
\Sigma.\mathrm{Dec}((k_S, k_T), c) = S.\mathrm{Dec}(k_S, T.\mathrm{Dec}(k_T, c))
35+
{% endkatex %}
36+
37+
If {% katex %}T{% endkatex %} has one-time uniform ciphertexts, then so does {% katex %}\Sigma{% endkatex %}. The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/GeneralDoubleOTUC.proof)
38+
39+
## Composing Two Symmetric Encryption Schemes for CPA$ security
40+
41+
This proof analyzes the same encryption scheme {% katex %}\Sigma{% endkatex %} as in the prior heading. If {% katex %}T{% endkatex %} is CPA$ secure, then so is {% katex %}\Sigma{% endkatex %}. The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/DoubleCPA%24.proof).
42+
43+
44+
## Double One-Time Pad has One-Time Uniform Ciphertexts
45+
46+
This proves [Claim 2.13](https://joyofcryptography.com/pdf/book.pdf#page=45).
47+
48+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Book/2/2_13.proof).
49+
50+
## Pseudo One-Time Pad has One-Time Uniform Ciphertexts
51+
52+
This proves [Claim 5.4](https://joyofcryptography.com/pdf/book.pdf#page=102)
53+
54+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Book/5/5_3.proof).
55+
56+
## Pseudorandomness of a length-tripling PRG
57+
58+
This proves [Claim 5.5](https://joyofcryptography.com/pdf/book.pdf#page=105)
59+
60+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/PRG/TriplingPRGSecure.proof).
61+
62+
## One-Time Secrecy implies CPA Security for Public Key Encryption Schemes
63+
64+
This proves [Claim 15.5](https://joyofcryptography.com/pdf/book.pdf#page=273)
65+
66+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/PubEnc/OTS%3D%3ECPA.proof).
67+
68+
## Hybrid Encryption is CPA secure
69+
70+
This proves [Claim 15.9](https://joyofcryptography.com/pdf/book.pdf#page=279)
71+
72+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/PubEnc/Hybrid.proof).
73+
74+
## Encrypt-then-MAC is CCA secure
75+
76+
This proves [Claim 10.10](https://joyofcryptography.com/pdf/book.pdf#page=205)
77+
78+
The proof file can be found [here](https://github.com/ProofFrog/examples/blob/main/Proofs/SymEnc/EncryptThenMACCCA.proof).

files/game.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Game Files
3+
layout: default
4+
parent: Files
5+
nav_order: 3
6+
---
7+
8+
# Game Files
9+
10+
Game files allow the user to specify security definitions in the form of a pair of games that must be proved indistinguishable.
11+
Each function listed in a game is provided implicitly to the adversary in the form of an oracle.
12+
Games may also contain private state that is maintained between oracle calls.
13+
Finally, each game has the option to specify an `Initialize` method which is assumed to be implicitly called before the adversary program starts.
14+
`Initialize` also has the ability to return information to the adversary that they may use during the attack (for example, adversaries should be provided the public key when attacking public key encryption).
15+
An example of a game file defining CPA security for symmetric encryption schemes is provided below.
16+
17+
```
18+
import 'examples/Primitives/SymEnc.primitive';
19+
20+
Game Left(SymEnc E) {
21+
E.Key k;
22+
Void Initialize() {
23+
k = E.KeyGen();
24+
}
25+
E.Ciphertext Eavesdrop(E.Message mL, E.Message mR) {
26+
return E.Enc(k, mL);
27+
}
28+
}
29+
30+
Game Right(SymEnc E) {
31+
E.Key k;
32+
Void Initialize() {
33+
k = E.KeyGen();
34+
}
35+
E.Ciphertext Eavesdrop(E.Message mL, E.Message mR) {
36+
return E.Enc(k, mR);
37+
}
38+
}
39+
40+
export as CPA;
41+
```
42+
In a proof file, we can then reference these two games by writing `CPA(E).Left` and `CPA(E).Right`.

files/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Files
3+
layout: default
4+
has_children: true
5+
has_toc: false
6+
---
7+
8+
ProofFrog has four types of files: [Primitive Files]({% link files/primitive.md %}), [Scheme Files]({% link files/scheme.md %}), [Game Files]({% link files/game.md %}) and [Proof Files]({% link files/proof.md %}).
9+
10+
Proof files are the only type of file that ProofFrog actually verifies, the remaining exist to provide definitions of security definitions and schemes to be used in proofs.
11+
12+
Examples for the syntax of each file can be found on the [Examples]({% link examples.md %}) page.
13+
14+
The full grammar for each of the file types, in ANTLR 4 syntax, can be found in [the GitHub repo](https://github.com/ProofFrog/ProofFrog/tree/main/proof_frog/antlr)

files/primitive.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: Primitive Files
3+
layout: default
4+
parent: Files
5+
nav_order: 1
6+
---
7+
8+
# Primitive Files
9+
10+
One can think of primitives as abstract classes from object oriented programming.
11+
A primitive file allows a user to describe the sets and functions that are associated with a particular mathematical object.
12+
A primitive contains constant fields and method signatures.
13+
An example of a primitive for an abstract symmetric encryption scheme is shown below.
14+
15+
```
16+
Primitive SymEnc(Set MessageSpace, Set CiphertextSpace, Set KeySpace) {
17+
Set Message = MessageSpace;
18+
Set Ciphertext = CiphertextSpace;
19+
Set Key = KeySpace;
20+
21+
Key KeyGen();
22+
Ciphertext Enc(Key k, Message m);
23+
Message Dec(Key k, Ciphertext c);
24+
}
25+
```
26+
27+
It is parameterized by three sets, and "stores" these sets as fields to be used in type-checking later on. It also defines method signatures for key generation, encryption, and decryption.

0 commit comments

Comments
 (0)