From de46599a970e2f0d3372a2ea96a3933102b9364d Mon Sep 17 00:00:00 2001
From: Jakob Unterwurzacher
Date: Sun, 24 Apr 2016 12:42:04 +0200
Subject: Describe long file name handling
---
docs/img/file-name-encryption.svg | 686 +++++++++++++++++++++-----------------
docs/img/longnames.svg | 364 ++++++++++++++++++++
docs/security.md | 23 ++
3 files changed, 760 insertions(+), 313 deletions(-)
create mode 100644 docs/img/longnames.svg
(limited to 'docs')
diff --git a/docs/img/file-name-encryption.svg b/docs/img/file-name-encryption.svg
index 45222e2..49eed5c 100644
--- a/docs/img/file-name-encryption.svg
+++ b/docs/img/file-name-encryption.svg
@@ -1,6 +1,4 @@
-
-
diff --git a/docs/img/longnames.svg b/docs/img/longnames.svg
new file mode 100644
index 0000000..2cf1684
--- /dev/null
+++ b/docs/img/longnames.svg
@@ -0,0 +1,364 @@
+
+
diff --git a/docs/security.md b/docs/security.md
index d43201a..fa74294 100644
--- a/docs/security.md
+++ b/docs/security.md
@@ -51,3 +51,26 @@ encryption.

The Base64 encoding limits the usable filename length to 176 characters.
+Filenames that are longer than that (longer than 255 characters in Base64-
+encoded form) use long file name handling (since gocrytfs v0.9).
+
+Long File Name Handling
+-----------------------
+
+If the Base64-encoded encrypted name is longer than 255 characters,
+it cannot be used as the file name on disk, as Linux filesystems
+do not allow names longer than that.
+
+Instead, the encrypted name is hashed, and the file content is stored in
+`gocryptfs.longname.[hash]`. The long file name is stored in a support
+file, `gocryptfs.longname.[hash].name`.
+
+
+
+This method for storing long file names has zero performance impact
+for filenames that are <= 176 characters, incurs no extra disk accesses
+for opening a file with a long name, and just one extra file read for each
+long-name file on readdir(1).
+
+Because the hash is only taken from the encrypted file name, there is no
+security penalty for using long names.
--
cgit v1.2.3