概要
ユーザのメールアドレスといった機密情報を暗号化・復号したいユースケースがあるとします。
メール送信などに利用するためパスワードのようにハッシュ化するのでなく、復号して利用したいケースです。
機密情報の管理全般については以前↓で話しましたが、今回はデータの暗号化に焦点を当ててみます。
前提知識
適切な暗号方法を理解していないとZoomで問題になったように脆弱性のあるアルゴリズムを使用してしまいます。
Zoom documentation claims that the app uses “AES-256” encryption for meetings where possible. However, we find that in each Zoom meeting, a single AES-128 key is used in ECB mode by all participants to encrypt and decrypt audio and video. The use of ECB mode is not recommended because patterns present in the plaintext are preserved during encryption.
なので暗号における前提知識を説明した後に具体的な実装を紹介します。
続きを読む