Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Building an Encrypted Virtual Filesystem in the...
Search
Cam Pedersen
December 13, 2013
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Building an Encrypted Virtual Filesystem in the Browser
Cam Pedersen
December 13, 2013
Other Decks in Programming
See All in Programming
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.1k
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
ChromeでローカルLLM
ryu1013
0
140
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
460
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
sbt 2.0: takeoff
eed3si9n
0
160
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
1
430
AmebaブログはKMPから卒業します
kmars0605
0
190
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
560
Event is what happens
moro
2
780
The Rails Doctrine Decade
koic
2
590
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Marketing to machines
jonoalderson
1
5.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
330
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Transcript
BUILDING AN ENCRYPTED VIRTUAL FILESYSTEM IN THE BROWSER
@campedersen Minneapolis •
None
None
WHY? window.requestFileSystem is young Only supported in WebKit File APIs
are local to the machine Want to store the files remotely
VIRTUAL FILE SYSTEMS user applications operating system hardware
VIRTUAL FILE SYSTEMS user applications operating system hardware
kernel space API inode/dentry caches drivers specific filesystems page/buffer caches
VFS
VIRTUAL FILESYSTEMS ALLOW ABSTRACTION FROM HARDWARE AND DATA STRUCTURE DETAILS
open() read() write() close() unlink() etc.
VFS DATA STRUCTURES superblock inodes dentries files
VFS DATA STRUCTURES superblock inodes dentries files metadata index nodes
directory entries points to data
–Atwood’s Law “Any application that can be written in JavaScript,
will eventually be written in JavaScript”
DIFFERENCES Everything has to live in user space Async is
hard Data structures are different
CRATE ARCHITECTURE Superblock() coordination Inode() Dentry() File() just data Crate()
API driver backend glue
ENTER ENCRYPTION Just use Crypton Everything is a container Eventually
we can share files easily
CONTAINER KEYS inodes dentries files just data _crate_inode_123 _crate_file_321
CONTAINER KEYS inodes dentries files just data f8c30f7cd2a0acf2f69313 1867d3f4ff36e6a8ffb6b1 a4ea27ede8fc099e8738
01fb7afcd76a62b1bd722e 813cbecf560991241cf557 e5400c9f1026b965b684
CONTAINER DATA inodes dentries files just data {“id":2, “dentries":[{"id":1,"name":".."}], “links":1,
“atime":0, “mtime":1386954461254, “ctime":1386954455150, “size":71498, “isDirectory":false, “fileId":3, "custom":{"type":"image/png"}} {“value":"data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAB7sAAAUn CAYAAAAsNwN2AAAABHNCS…="}
CONTAINER DATA inodes dentries files just data {“iv":"6dBwnCXN8dV8B4iruDH4lw","v":1, “iter":1000,"ks":128,"ts":64, “mode":"gcm","adata":"","cipher":"aes",
“ct”:”fsUndHDCsROgLHglmzPN48oPF1+s…"} {“iv”:"GRcbuBDEIuCVJno/4xIrnA","v":1, “iter":1000,"ks":128,"ts":64,"mode":"gcm", “adata":"","cipher":"aes", “ct”:”a0b9/ggRWslifA..."}
crate in userspace var fs = new Crate({ driver: 'localStorage',
}, function (err) { fs.open(‘/foo’, function (err, file) { file.write(‘bar’, function (err) { console.log(‘i made a file in js!’); }); }); }); !
crate with encryption var fs = new Crate({ driver: ‘crypton',
options: { session: cryptonSession } }, function (err) { fs.open(‘/foo’, function (err, file) { file.write(‘bar’, function (err) { console.log(‘i encrypted a file!’); }); }); }); !
opening files fs.open(path, function (err, file) { file.read(function (err, data)
{ var blob = dataURItoBlob(data); var url = URL.createObjectURL(blob); var name = file.name; var reference = window.open(url, name, null); URL.revokeObjectURL(url); }); });
saving files fs.open(path, function (err, file) { file.read(function (err, data)
{ var link = document.createElement('a'); link.href = data; link.download = file.name; document.body.appendChild(link); link.click(); document.body.removeChild(link); }); });
PROBLEMS Inconsistent APIs No Web Workers in Crypton Took a
lot of shortcuts
IT’S NOT DONE YET Tests Symlinks General features More drivers/backends
@campedersen !
[email protected]
! github.com/ecto/crate IF IT SOUNDS INTERESTING, COME
HACK WITH ME