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
EncryptedSharedPreferenceの後継OSSライブラリDataStore C...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ichimura
November 15, 2025
160
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
EncryptedSharedPreferenceの後継OSSライブラリDataStore Cryptoを紹介
ichimura
November 15, 2025
More Decks by ichimura
See All by ichimura
謎の現象を発見してプチ英雄になりました
ichir438
0
210
Google/IO 2025 "Build adaptive Android apps that shine across form factors"の紹介
ichir438
0
540
Featured
See All Featured
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
410
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
900
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
The untapped power of vector embeddings
frankvandijk
2
1.9k
Google's AI Overviews - The New Search
badams
0
1.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
420
Building Applications with DynamoDB
mza
96
7.2k
Transcript
EncryptedSharedPreferenceの 後継OSSライブラリ DataStore Cryptoを紹介
DataStore Cryptoとは EncryptedSharedPreferenceの後継として今年9月に公開したOSSライブラリ https://github.com/cybozu/datastore-crypto
Encrypted SharedPreferences とは • Androidアプリ開発お馴染みのSharedPreferencesが保存する データを暗号化・複合化してくれるライブラリ • 端末に保存する機密データの漏洩リスクを軽減できる • ただし、現在はdeprecatedになっている
→ 使いたいのでDataStore Cryptoを作りました!
なぜDeprecatedになった? 今年のDroidKaigiでYuki Anzaiさんが同内容のセッションで紹介されていました!
Deprecatedの理由をざっくり紹介 • ライブラリの動作が不安定になってきた • リスクの高いデータはそもそもデバイスに保存しない設計にすべき • AndroidOSはファイルベースの暗号化とサンドボックスモデル によって十分保護されている • OS保護以上のセキュリティを担保したい場合は、
そのプロセスを完全に理解して制御しよう
Q: Deprecatedの理由を分かった上でなぜ必要なのか A: 既にEncryptedSharedPreferenceが組み込まれたプロダクトは代替手段が必要
Q: ちなみにどんなデータを保護したい? • 認証関連のトークン類(これがメイン) • ユーザーに関連する秘密情報 など
DataStoreCryptoの概要 • EncryptedSharedPreferenceの暗号化・複合化機構(Tink)をDataStoreに移植 • 使用者は普通のDataStoreと同じ要領で実装できる
DataStore Cryptoをプロダクトに組み込む デリゲートプロパティの宣言
DataStore Cryptoをプロダクトに組み込む (2/2) 書き込み関数の例
DataStore Cryptoをプロダクトに組み込む 読み取り関数の定義の例
EncryptedSharedPreferenceからの移行 datastoreがsharedPreferenceから移行するマイグレーション機能を活用できる
まとめ • DataStoreCryptoは保存データの暗号化、複合化機能を提供 • 使用感はほぼDataStoreと同様 • EncryptedSharedPreferenceからのマイグレーションも可能