了解设备是否是完整的磁盘加密和使用什么加密? [英] Find out whether the device is full disk encrypted and what encryption was used?

查看:452
本文介绍了了解设备是否是完整的磁盘加密和使用什么加密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于支持Android 3.0全磁盘加密,但我看不到任何API。我需要知道的两个具体事项是:

Since Android 3.0 full disk encryption is supported, but I can't see any API to that ability. The two specific things I need to know are:


  1. 设备是否加密?

  2. 什么使用加密。

我发现了一个低级别的进程这里,似乎建议使用的加密是128 AES与CBC和ESSIV:SHA256,但它不谈论一种方法来查找设备已加密。

I found a low level explanation of the process here and it seems to suggest the encryption used is 128 AES with CBC and ESSIV:SHA256, but it does not talk about a way to find whether the device is encrypted.

所以,我的应用程序是否可以查询设备是否使用完整磁盘加密功能,或者我需要诉诸于hacky解决方案Runtime.exec调用?

So, is there a way my app can query whether the device is using the full disk encryption feature, or do I need to resort to hacky solutions like Runtime.exec calls?

推荐答案

正如@Mikle所提及的,您只需调用 DevicePolicyManager 并请求状态

As @Mikle mentions you can just call the DevicePolicyManager and ask it the status

@SuppressLint("NewApi")
    private boolean isEncrypted(Context context) {
        DevicePolicyManager devicePolicyManager = (DevicePolicyManager) context
                .getSystemService(Context.DEVICE_POLICY_SERVICE);

        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.HONEYCOMB) {
            int status = devicePolicyManager.getStorageEncryptionStatus();
            if (DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE == status) {
                return true;
            }
        }
        return false;
    }

这篇关于了解设备是否是完整的磁盘加密和使用什么加密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆