简体   繁体   English

在Android设备中读取和写入mifare卡

[英]Reading and wrinting mifare cards in android devices

Is it possible to access the nfc functions on android devices from native code? 是否可以从本机代码访问Android设备上的nfc函数?

I was thinking that I could use native code to read and write mifare cards, this would add more security because it is not easy to decompile. 我以为我可以使用本机代码来读写mifare卡,这会增加安全性,因为它不容易反编译。 but I am not sure if the native android apis support mifare cards. 但我不确定本机android apis是否支持mifare卡。

I have an application written in Java to read and write mifare cards in android devices. 我有一个用Java编写的应用程序来读取和编写Android设备中的mifare卡。 The keys and the binary information stored in the cards were already designed and I have no control over it. 存储在卡中的密钥和二进制信息已经设计好,我无法控制它。

It was easy for me to decompile and deobfuscate the generated apk. 我很容易对生成的apk进行反编译和反混淆。 So it is easy to get the card's keys, even when they are encrypted. 所以很容易获得卡的密钥,即使它们是加密的。 This is a problem because security is important. 这是一个问题,因为安全性很重要。

Is there any other way to improve the security of the application? 有没有其他方法可以提高应用程序的安全性? I want to make it hard to extract the keys. 我想让提取密钥变得困难。

What you're talking about is called "security through obscurity". 你所说的被称为“通过默默无闻的安全”。 While its slightly better than nothing, its generally considered close to useless- no matter how much you hide the code, it will be cracked fairly easily. 虽然它略胜一筹,但它通常被认为是无用的 - 无论你隐藏多少代码,它都会很容易破解。 For example, using an emulator I could put a breakpoint in the framework function that reads data from the card, then place a memory breakpoint and see where the returned data is used to find your code. 例如,使用模拟器我可以在框架函数中放置一个断点,从卡中读取数据,然后放置一个内存断点,并查看返回的数据用于查找代码的位置。

Native code won't be much harder than Java, anyone who does reverse engineering is well versed in reading assembly. 原生代码不会比Java困难,任何进行逆向工程的人都非常精通阅读程序集。 In the end you're adding a few days to the time it takes to crack the device at best. 最后,您需要花费几天的时间来充分破解设备。 You really need to fix the cards. 你真的需要修理卡片。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM