Skip to content

Commit a847db1

Browse files
committed
Merge branch 'develop'
2 parents 466726d + a5de6e3 commit a847db1

File tree

7 files changed

+71
-15
lines changed

7 files changed

+71
-15
lines changed

docs/security/architecture.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ wrappedEncryptionMasterKey := aesKeyWrap(encryptionMasterKey, kek)
121121
wrappedMacMasterKey := aesKeyWrap(macMasterKey, kek)
122122
```
123123

124-
<Image src="/img/security/key-derivation.png" srcset="/img/security/key-derivation.png 1x, /img/security/key-[email protected] 2x" alt="KEK Derivation" width="336" height="71" style={{backgroundColor: '#ffffff', borderRadius: 'var(--ifm-global-radius)', padding: 'var(--ifm-pre-padding)', boxSizing: 'content-box'}} />
124+
<WhiteBox>
125+
<Image src="/img/security/key-derivation.png" srcset="/img/security/key-derivation.png 1x, /img/security/[email protected] 2x" alt="KEK Derivation" width="336" height="71" />
126+
</WhiteBox>
125127

126128
The wrapped keys and the parameters needed to derive the KEK are then stored as integers or Base64-encoded strings in a JSON file named `masterkey.cryptomator`, which is located in the root directory of the vault.
127129

@@ -139,4 +141,6 @@ The wrapped keys and the parameters needed to derive the KEK are then stored as
139141

140142
When unlocking a vault the KEK is used to unwrap (i.e. decrypt) the stored masterkeys.
141143

142-
<Image src="/img/security/masterkey-decryption.png" srcset="/img/security/masterkey-decryption.png 1x, /img/security/masterkey-[email protected] 2x" alt="Masterkey Decryption" width="439" height="200" style={{backgroundColor: '#ffffff', borderRadius: 'var(--ifm-global-radius)', padding: 'var(--ifm-pre-padding)', boxSizing: 'content-box'}} />
144+
<WhiteBox>
145+
<Image src="/img/security/masterkey-decryption.png" srcset="/img/security/masterkey-decryption.png 1x, /img/security/[email protected] 2x" alt="Masterkey Decryption" width="439" height="200" />
146+
</WhiteBox>

docs/security/vault.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ cleartextPayload := 0xFFFFFFFFFFFFFFFF . contentKey
2424
ciphertextPayload, tag := aesGcm(cleartextPayload, encryptionMasterKey, headerNonce)
2525
```
2626

27-
<Image src="/img/security/file-header-encryption.png" srcset="/img/security/file-header-encryption.png 1x, /img/security/file-[email protected] 2x" alt="File Header Encryption" width="433" height="199" style={{backgroundColor: '#ffffff', borderRadius: 'var(--ifm-global-radius)', padding: 'var(--ifm-pre-padding)', boxSizing: 'content-box'}} />
28-
29-
*Random per file change
27+
<WhiteBox>
28+
<Image src="/img/security/file-header-encryption.png" srcset="/img/security/file-header-encryption.png 1x, /img/security/[email protected] 2x" alt="File Header Encryption" width="433" height="199" />
29+
<WhiteBoxCaption>*Random per file change</WhiteBoxCaption>
30+
</WhiteBox>
3031

3132
## File Content Encryption {#file-content-encryption}
3233

@@ -54,9 +55,10 @@ for (int i = 0; i < length(cleartextChunks); i++) {
5455
ciphertextFileContent := join(ciphertextChunks[])
5556
```
5657

57-
<Image src="/img/security/file-content-encryption.png" srcset="/img/security/file-content-encryption.png 1x, /img/security/file-[email protected] 2x" alt="File Content Encryption" width="782" height="195" style={{backgroundColor: '#ffffff', borderRadius: 'var(--ifm-global-radius)', padding: 'var(--ifm-pre-padding)', boxSizing: 'content-box'}} />
58-
59-
*Random per chunk change
58+
<WhiteBox>
59+
<Image src="/img/security/file-content-encryption.png" srcset="/img/security/file-content-encryption.png 1x, /img/security/[email protected] 2x" alt="File Content Encryption" width="782" height="195" />
60+
<WhiteBoxCaption>*Random per chunk change</WhiteBoxCaption>
61+
</WhiteBox>
6062

6163
## Directory IDs {#directory-ids}
6264

@@ -94,9 +96,10 @@ Cryptomator uses [AES-SIV](https://tools.ietf.org/html/rfc5297) to encrypt names
9496
The directory ID of the parent folder is passed as associated data.
9597
This prevents undetected movement of files between directories.
9698

97-
<Image src="/img/security/filename-encryption.png" srcset="/img/security/filename-encryption.png 1x, /img/security/filename-[email protected] 2x" alt="Filename Encryption" width="614" height="220" style={{backgroundColor: '#ffffff', borderRadius: 'var(--ifm-global-radius)', padding: 'var(--ifm-pre-padding)', boxSizing: 'content-box'}} />
98-
99-
*Unencrypted directory ID of the parent dir [as described above](#directory-ids)
99+
<WhiteBox>
100+
<Image src="/img/security/filename-encryption.png" srcset="/img/security/filename-encryption.png 1x, /img/security/[email protected] 2x" alt="Filename Encryption" width="614" height="220" />
101+
<WhiteBoxCaption>*Unencrypted directory ID of the parent dir [as described above](#directory-ids)</WhiteBoxCaption>
102+
</WhiteBox>
100103

101104
```
102105
ciphertextName := base64url(aesSiv(cleartextName, parentDirId, encryptionMasterKey, macMasterKey)) + '.c9r'

src/components/Image.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import useBaseUrl from '@docusaurus/useBaseUrl';
22
import React from 'react';
33
import { GridContext } from './GridContext';
4+
import { WhiteBoxContext } from './WhiteBoxContext';
45

56
interface ImageProps {
67
src: string;
@@ -9,12 +10,12 @@ interface ImageProps {
910
width?: number | string;
1011
height?: number | string;
1112
className?: string;
12-
style?: React.CSSProperties;
1313
}
1414

15-
export default function Image({ src, srcset, alt, width, height, className, style }: ImageProps) {
15+
export default function Image({ src, srcset, alt, width, height, className }: ImageProps) {
1616
const imageSrc = useBaseUrl(src);
1717
const isInsideGrid = React.useContext(GridContext);
18+
const isInsideWhiteBox = React.useContext(WhiteBoxContext);
1819
const processedSrcset = srcset
1920
? srcset
2021
.split(',')
@@ -34,10 +35,10 @@ export default function Image({ src, srcset, alt, width, height, className, styl
3435
className={className}
3536
decoding="async"
3637
loading="lazy"
37-
style={{ height: 'auto', ...style }}
38+
style={{ height: 'auto' }}
3839
/>
3940
);
40-
if (isInsideGrid) {
41+
if (isInsideGrid || isInsideWhiteBox) {
4142
return imageElement;
4243
}
4344
return <p>{imageElement}</p>;

src/components/WhiteBox.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { WhiteBoxContext } from './WhiteBoxContext';
3+
4+
interface WhiteBoxProps {
5+
children: React.ReactNode;
6+
}
7+
8+
export default function WhiteBox({ children }: WhiteBoxProps) {
9+
return (
10+
<WhiteBoxContext.Provider value={true}>
11+
<p style={{
12+
backgroundColor: '#ffffff',
13+
borderRadius: 'var(--ifm-global-radius)',
14+
boxShadow: 'var(--ifm-global-shadow-lw',
15+
display: 'inline-block',
16+
padding: 'var(--ifm-pre-padding)',
17+
}}>
18+
{children}
19+
</p>
20+
</WhiteBoxContext.Provider>
21+
);
22+
}

src/components/WhiteBoxCaption.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
3+
interface WhiteBoxCaptionProps {
4+
children: React.ReactNode;
5+
}
6+
7+
export default function WhiteBoxCaption({ children }: WhiteBoxCaptionProps) {
8+
return (
9+
<p style={{
10+
color: 'var(--ifm-color-gray-900)',
11+
display: 'block',
12+
fontSize: 'var(--ifm-code-font-size)',
13+
marginBottom: '0',
14+
marginTop: 'var(--ifm-leading)'
15+
}}>
16+
{children}
17+
</p>
18+
);
19+
}

src/components/WhiteBoxContext.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { createContext } from 'react';
2+
3+
export const WhiteBoxContext = createContext(false);

src/theme/MDXComponents.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import Grid from '@site/src/components/Grid';
22
import Image from '@site/src/components/Image';
33
import MobileGrid from '@site/src/components/MobileGrid';
4+
import WhiteBox from '@site/src/components/WhiteBox';
5+
import WhiteBoxCaption from '@site/src/components/WhiteBoxCaption';
46
import MDXComponents from '@theme-original/MDXComponents';
57

68
export default {
79
...MDXComponents,
810
Grid,
911
Image,
1012
MobileGrid,
13+
WhiteBox,
14+
WhiteBoxCaption,
1115
};

0 commit comments

Comments
 (0)