Android安全支付(1)-整体架构-keymint

深入解析Android安全架构:从Keystore到KeyMint的演进与Trusty TEE的实践 本文深入解析Android安全架构的演进,重点探讨从Keystore到KeyMint的技术升级及Trusty TEE的实践应用。通过硬件级防护、密钥管理和安全认证等实战案例,揭示Android 14在安全领域的创新设计,帮助开发者构建更安全的移动应用环境。 阅读详情

目录

一、整体架构

1.app到keystore

2.keystore到keymaster(这部分,不同版本会有不同的实现)

3.keymaster到trusty

4.trusty内部的ipc机制调用到TA

5.trusty TA

二、采用keymint还是keymaster

三、keymint接口定义和具体实现

(1)接口定义

(2)AndroidKeyMintDevice(具体实现服务端示例)

(3)trusty KeyMintDevice(具体实现服务端的另一个示例)

四、trusty TA对硬件的操作调用和通信

五、总结


一、整体架构

我们来看下如何基于已有的Android系统框架和安全架构,如何为区块链用户在arm平台的android设备上添加一颗安全芯片,提供硬件级别的安全支付能力和硬件设备。【ps:所有公开内容将仅限于对已开源的AOSP源码的分析】

整体的框架(官方图镇楼):

我们首先以一个简单应用到TA的调用流程来作为整个分析的索引,然后逐步拆解开来。

1.app到keystore

2.keystore到keymaster(这部分,不同版本会有不同的实现)

3.keymaster到trusty


4.trusty内部的ipc机制调用到TA



5.trusty TA


二、采用keymint还是keymaster

在keystore功能的底层实现上,android在不同的版本有不同的实现。
keymint是keymaster v4

Android安全支付基石:KeyMint架构与密钥管理全解析 在移动应用安全领域,密钥管理是构建可信执行环境的核心环节。Android系统通过硬件级安全模块,将私钥的生成、存储与运算隔离在独立的安全世界(TEE或StrongBox)中,从芯片层面阻断软件攻击对密钥材料的窃取。这种基于硬件隔离的密钥保护机制,为支付、身份认证、FIDO2等敏感业务提供了信任根。开发者通过标准API即可调用签名、解密、密钥认证等能力,而实际密码学运算全部下沉至安全芯片完成。理解这一架构,有助于设计高安全性的移动支付方案,并在服务端建立基于Attestation的设备可信校验。本文从Andr 阅读详情

相关推荐

Android keymint(keymaster)一RKP

Android RKP

weixin_47139576的博客 1万+

Strongbox和Weaver

本篇文章主要是介绍Strongbox和Weaver的技术架构,其中包含的一些技术细节,只是实现方式中的一种,对于其他不同的情况,还需要OEM和SE发行商之间协定具体的技术流程。这篇文章的主要目的是帮助想要了解Strongbox和Weaver技术细节的人,快速的了解整个体系框架,并可以在此基础上设计属于自己的Strongbox和Weaver方案。关键词:Keystore, Keymint, Keymaster,TEE, Strongbox, RKP, ROT, Attestation key。

baidu_25966105的博客 5407

Android安全支付架构解析:KeyMint密钥管理与TEE/StrongBox实战

在移动应用开发中,数据加密与密钥保护是构建可信支付链路的核心。Android系统通过引入KeyMint取代传统Keymaster,将密钥操作下沉到TEE或StrongBox安全硬件中,实现私钥不可读取、不可降级的硬件级防护。本文从可信执行环境的概念出发,解析密钥生成、存储、签名及认证的全生命周期管理,结合生物识别绑定和版本计数机制,说明如何抵御root、注入、降级攻击等风险。同时对比TEE与StrongBox的选型差异,给出支付场景下的密钥管理与服务端验签实践。理解这套从应用层到安全芯片的信任链,能帮助开发

weixin_29172963的博客 292

Android Keymaster/KeyMint:硬件级密钥管理与认证原理与NPI实践

在移动设备安全领域,硬件级密钥管理与密码学操作是构建可信执行环境(TEE)的核心技术。其基本原理是将敏感的密钥生成、存储和运算过程,从易受攻击的富执行环境(REE)转移到隔离的安全硬件区域执行,从而确保即使操作系统被攻破,密钥材料也不会泄露。这项技术的核心价值在于为移动支付、企业身份认证、数字版权管理等高安全场景提供了硬件级信任根。在Android生态中,Keymaster(后演进为KeyMint)正是实现这一目标的系统级安全模块,它通过密钥认证(Attestation)机制,使远程服务器能够验证密钥确实由

weixin_29159127的博客 326

Android 14密钥管理深度解析:从Keystore到Keymint的架构演进与Trusty安全实践

本文深入解析Android 14密钥管理系统的架构演进,从Keystore到Keymint的技术升级,以及Trusty安全环境的最佳实践。详细探讨了Keystore2的性能优化、Keymint的标准化设计,以及如何在Trusty TEE中实现安全密钥管理,为开发者提供构建现代密钥管理系统的实用指南。

weixin_42533120的博客 256

Keystore/Keystore2/Keymaster/Keymint 深入剖析 嵌入式

本文深入学习了 Keystore、Keystore2、Keymaster 和 Keymint 这些在嵌入式系统中保护和管理密钥的关键组件。Keystore、Keystore2、Keymaster和Keymint 是一系列用于保护和管理密钥及其相关操作的关键组件。安全的密钥派生:Keystore2 支持衍生密钥派生(Key Derivation),通过一个主密钥衍生出多个子密钥,从而更好地保护密钥和数据。密钥生成和导入:Keymaster 支持生成和导入各种类型的密钥,包括对称密钥、非对称密钥和证书等。

CyberSphinx的博客 1448

【置顶】Android15安全架构精选-[目录]

讲述android13最新安全架构,包括但不限于:Gatekeeper(locksetting)、生物认证(指纹fingerprint、人脸faceid)、keystore/keystore2/keymaster/keymint、googlekey(attesstation key).....

baron-周贺贺-代码改变世界ctw 7315

《Android KeymasterKeymint精讲》

课程大纲: Keystore/Keystore2/keymaster/keymint的概念 keymaster/keymint的版本演进 keymint接口示例 Keystore/keymaster/keymint/Strongbox 软件框架 Keystore软件框架 Keystore算法使用示例 要求进行用户身份验证才能使用密钥 Keystore-strongbox 算法使用示例 AuthToken的使用示例 A/B System AVB 2.0 AVB需求和设计 RootOfTrust 定义 Root of trust binding ROT的介绍 版本绑定 Trusty CA和TA通信的定义 Trusty CA和TA的代码 Keymaster和keymint HAL接口定义 Android attestation Key Android RKP Keystore异常示例 strongbox........

Cursor生成JAVA相关的关键词提示规则

你是 Java 编程、Spring Boot、Spring Framework、Maven、JUnit 及相关 Java 技术的专家。在项目根目录创建一个.curstorrules文件(注意有个小数点),之后在该文件内填入下面内容。始终遵循 SOLID 原则,保持高内聚低耦合的 Spring Boot 应用设计。Java 和 Spring Boot 使用规范。Spring Boot 具体规范。

kitonGao的博客 2108

告别混乱!用Cadence Capture CIS高效管理你的原理图库:以单逻辑器件K9F2G08U0M为例

本文以单逻辑器件K9F2G08U0M为例,详细介绍了如何使用Cadence Capture CIS高效管理原理图库。通过三级分类体系、工程化命名规范和智能检索技术,帮助工程师实现从混乱到有序的转变,提升团队协作效率和设计准确性。

aizhi0169的博客 395

DTI-ALPS处理笔记

前段时间刚好学习了一下DTI-ALPS处理(diffusion tensor image analysis along the perivascular space ),记录一下,以便后续学习。ALPS是2017年发表在《Japanese Journal of Radiology》的一篇文章首次提出的 (),主要用于无创评估脑内淋巴系统功能的衡量数值。C图和D图中的蓝色部分是投射纤维,绿色部分是联合纤维,红色部分是皮下纤维。

weixin_52073820的博客 4771

【OpenClaw从入门到精通】第23篇:OpenClaw办公自动化实战—报表生成+文档批量处理+跨系统同步(2026实操进阶版)

本文聚焦OpenClaw在办公自动化场景的进阶应用,针对职场中高频且重复的报表生成、文档批量处理、跨系统数据同步三大痛点,提供从环境搭建、原理讲解到完整代码实现的全流程实操指南。方案基于Python生态工具链(pandas、Playwright、PyPDF2等)与OpenClaw的低代码编排能力,兼顾新手入门与进阶提升——新手可直接复用代码快速落地,进阶读者可学习流程编排逻辑进行二次开发。所有案例均基于真实办公场景设计,部分虚拟场景已明确标注,代码经本地环境验证可复现。

专注于人工智能、软件开发、工控自动化、工厂数字化及智能化等领域,希望和大家共同进步! 954

PCL 模型滤波器【2025最新版】

根据给定的模型系数在点云中提取对应于模型的点云数据。博客长期更新,本文最新更新时间为:2025年6月17日。

点云侠的博客 4378

华为OD机试真题2026双机位C卷 Python&JS 实现【明日之星选举】

给定一组选票votes。votes[i]代表第 i 张选票的内容,包含一个字符串"zhangsan,hanmei",表示推荐zhangsan为明日之星,反对 hanmei 称为明日之星。赞成或反对使用逗号(,)分割。 给定一个数组n,表示最后将筛选出赞成票最多的n个人,如果赞成票相同,则反对票越少,排序越靠前;如果赞成票和反对票都相同,则按照姓名字典序升序排序。

MISAYAONE的博客 309

CVE-2021-3156本地提权漏洞复现

受影响版本 sudo: 1.8.2 - 1.8.31p2 sudo: 1.9.0 - 1.9.5p1 测试 我这里是在本地centos7上进行测试。 需要目标机器上存在python编译器、目标主机出网或者能上传文件到目标主机。 以非root用户登录系统,并运行如下命令: sudoedit -s / 通常响应一个以 sudoedit: / 开头的报错,多半存在漏洞。 利用 提权脚本: https://www.o2oxy.cn/wp-content/uploa

The current road is different, love needs to distinguish between right and wrong 3773

电商平台系统需求规格说明书(示例)

​​电商系统​​:指本文件所描述的集商品展示、销售、支付、物流跟踪、用户管理等功能于一体的综合性在线购物平台。​​API​​:应用程序编程接口(Application Programming Interface),用于实现系统各模块之间或与外部系统之间的数据交互和功能调用。

跟佟格湾一起学习计算机知识吧~ 1251

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

上一篇: Android安全支付(5)-软件架构-trusty-keymaster TA
下一篇: Android安全支付(3)-安全架构-KeyStore2-Key类簇和Spi类簇
duansilence
博客等级 码龄15年 125粉丝 112原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值