Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release thay vì aosp-main để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Mã hoá là quá trình mã hoá tất cả dữ liệu người dùng trên thiết bị Android bằng khoá mã hoá đối xứng. Sau khi thiết bị được mã hoá, tất cả dữ liệu do người dùng tạo sẽ tự động được mã hoá trước khi được ghi vào ổ đĩa và tất cả các thao tác đọc sẽ tự động giải mã dữ liệu trước khi trả về cho quy trình gọi. Quy trình mã hoá đảm bảo rằng ngay cả khi một bên không được uỷ quyền cố gắng truy cập vào dữ liệu, họ cũng sẽ không thể đọc được dữ liệu đó.
Android có hai phương thức mã hoá thiết bị: mã hoá dựa trên tệp và mã hoá toàn bộ đĩa.
Mã hoá dựa trên tệp
Android 7.0 trở lên hỗ trợ mã hoá dựa trên tệp.
Tính năng mã hoá dựa trên tệp cho phép mã hoá các tệp khác nhau bằng các khoá khác nhau có thể được mở khoá độc lập. Các thiết bị hỗ trợ phương thức mã hoá dựa trên tệp cũng có thể hỗ trợ chế độ Khởi động trực tiếp. Chế độ này cho phép các thiết bị được mã hoá khởi động thẳng đến màn hình khoá, nhờ đó cho phép truy cập nhanh vào các tính năng quan trọng của thiết bị như dịch vụ hỗ trợ tiếp cận và báo thức.
Với tính năng mã hoá dựa trên tệp và các API giúp ứng dụng nhận biết được hoạt động mã hoá, các ứng dụng có thể hoạt động trong một bối cảnh hạn chế. Điều này có thể xảy ra trước khi người dùng cung cấp thông tin đăng nhập mà vẫn bảo vệ thông tin riêng tư của người dùng.
Mã hoá siêu dữ liệu
Android 9 hỗ trợ mã hoá siêu dữ liệu khi có sự hỗ trợ của phần cứng. Với tính năng mã hoá siêu dữ liệu, một khoá duy nhất có trong thời gian khởi động sẽ mã hoá mọi nội dung không được FBE mã hoá, chẳng hạn như bố cục thư mục, kích thước tệp, quyền và thời gian tạo/sửa đổi. Khoá này được bảo vệ bằng KeyMint (trước đây là Keymaster), và KeyMint lại được bảo vệ bằng tính năng Xác minh quy trình khởi động.
Mã hoá toàn bộ ổ đĩa
Android 5.0 đến Android 9 hỗ trợ mã hoá toàn bộ đĩa.
Tính năng mã hoá toàn bộ ổ đĩa sử dụng một khoá duy nhất (được bảo vệ bằng mật khẩu thiết bị của người dùng) để bảo vệ toàn bộ phân vùng dữ liệu người dùng của thiết bị. Khi khởi động, người dùng phải cung cấp thông tin xác thực trước khi có thể truy cập vào bất kỳ phần nào của ổ đĩa.
Mặc dù điều này rất tốt cho việc bảo mật, nhưng có nghĩa là hầu hết chức năng cốt lõi của điện thoại sẽ không hoạt động ngay khi người dùng khởi động lại thiết bị.
Vì quyền truy cập vào dữ liệu của họ được bảo vệ bằng thông tin đăng nhập duy nhất của người dùng, nên các tính năng như báo thức không hoạt động, dịch vụ hỗ trợ tiếp cận không dùng được và điện thoại không nhận được cuộc gọi.
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[],null,["# Encryption is the process of encoding all user data on an Android device using\nsymmetric encryption keys. Once a device is encrypted, all user-created data is\nautomatically encrypted before committing it to disk and all reads automatically\ndecrypt data before returning it to the calling process. Encryption ensures that\neven if an unauthorized party tries to access the data, they won't be able to\nread it.\n\n\nAndroid has two methods for device encryption: file-based encryption and\nfull-disk encryption.\n\nFile-based encryption\n---------------------\n\n\nAndroid 7.0 and later supports\n[file-based encryption](/docs/security/features/encryption/file-based).\nFile-based encryption allows different files to be encrypted with different\nkeys that can be unlocked independently. Devices that support file-based\nencryption can also support\n[Direct\nBoot](https://developer.android.com/training/articles/direct-boot), which allows encrypted devices to boot straight to the lock screen,\nthus enabling quick access to important device features like accessibility\nservices and alarms.\n\n\nWith file-based encryption and APIs that make apps aware of encryption, apps\ncan operate within a limited context. This can happen before users have\nprovided their credentials while still protecting private user information.\n\n### Metadata encryption\n\n\nAndroid 9 introduces support for\n[metadata encryption](/docs/security/features/encryption/metadata), where hardware\nsupport is present. With metadata encryption, a single key present at boot time\nencrypts whatever content is not encrypted by FBE, such as directory layouts,\nfile sizes, permissions, and creation/modification times. This key is protected\nby KeyMint (previously Keymaster), which in turn is protected by Verified Boot.\n\nFull-disk encryption\n--------------------\n\n| **Note:** Full-disk encryption is not allowed on new devices running Android 10 and higher. For new devices, use [file-based encryption](/docs/security/features/encryption/file-based).\n\n\nAndroid 5.0 up to Android 9 support\n[full-disk encryption](/docs/security/features/encryption/full-disk).\nFull-disk encryption uses a single key---protected with the user's device password---to\nprotect the whole of a device's userdata partition. Upon boot, the user must\nprovide their credentials before any part of the disk is accessible.\n\n\nWhile this is great for security, it means that most of the core functionality\nof the phone is not immediately available when users reboot their device.\nBecause access to their data is protected behind their single user credential,\nfeatures like alarms could not operate, accessibility services were unavailable,\nand phones could not receive calls."]]