Droidcedas : Credential Storage Enhancements Inwards Android 4.3

Our without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been previous post was non related to Android security, but happened to coincide amongst the without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been somewhat without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been recurring without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been topic on this blog, got a pregnant facelift too, thus we'll facial expression into it first. This transportation volition focus mainly on the newly introduced features together with interfaces, thus y'all mightiness desire to review previous credential storage posts earlier continuing.

What's novel inwards 4.3

First together with foremost, the organisation credential store, at nowadays officially named 'Android Key Store' has a world without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been possible earlier too, but non officially supported together with somewhat clunky on pre-ICS devices. Next, spell only the primary (owner) user could usage the organisation fundamental shop pre-4.3, at nowadays it is multi-user compatible together with each user gets their ain keys. Finally, at that topographic point is an API together with fifty-fifty a organisation settings land that lets y'all cheque whether the credential shop is hardware-backed (Nexus 4, Nexus 7) or software only (Galaxy Nexus). While the core functionality hasn't changed much since the previous release, the implementation strategy has evolved quite a bit, thus nosotros volition facial expression briefly into that too. That's a lot to cover, thus lets' larn started.

Public API

The API is outlined inwards the 'Security' department of the 4.3 novel API introduction page, together with details tin give the sack last constitute inwards the official SDK reference, thus nosotros volition only review it briefly. Instead of introducing yet some other Android-specific API, fundamental shop access is exposed via touchstone JCE APIs, namely KeyGenerator together with KeyStore. Both are backed past times a novel Android JCE provider, AndroidKeyStoreProvider together with are accessed past times passing "AndroidKeyStore" every bit the type parameter of the respective mill methods (those APIs were truly available inwards 4.2 every bit well, but were non public). For a total sample detailing their usage, refer to the BasicAndroidKeyStore project inwards the Android SDK. To innovate their usage briefly, kickoff y'all create a KeyPairGeneratorSpec that describes the keys y'all desire to generate (including a self-signed certificate), initialize a KeyPairGenerator amongst it together with and thus generate the keys past times calling generateKeyPair(). The most of import parameter is the alias, which y'all together with thus top to KeyStore.getEntry() inwards club to larn a receive to the generated keys later. There is currently no way to specify fundamental size or type together with generated keys default to 2048 flake RSA. Here's how all this looks like:

// generate a fundamental yoke Context ctx = getContext(); Calendar notBefore = Calendar.getInstance() Calendar notAfter = Calendar.getInstance(); notAfter.add(1, Calendar.YEAR); KeyPairGeneratorSpec spec = novel KeyPairGeneratorSpec.Builder(ctx)                 .setAlias("key1")                 .setSubject(                         novel X500Principal(String.format("CN=%s, OU=%s", alais,                                 ctx.getPackageName())))                 .setSerialNumber(BigInteger.ONE).setStartDate(notBefore.getTime())                 .setEndDate(notAfter.getTime()).build();  KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("RSA", "AndroidKeyStore"); kpGenerator.initialize(spec); KeyPair kp = kpGenerator.generateKeyPair();  // inwards some other component subdivision of the app, access the keys KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); KeyStore.PrivateKeyEntry keyEntry = (KeyStore.PrivateKeyEntry)keyStore.getEntry("key1", null); RSAPublicKey pubKey = (RSAPublicKey)keyEntry.getCertificate().getPublicKey(); RSAPrivateKey privKey = (RSAPrivateKey) keyEntry.getPrivateKey(); 

If the device has a hardware-backed fundamental shop implementation, keys volition last generated exterior of the Android OS together with won't last straight accessible fifty-fifty to the organisation (or root user). If the implementation is software only, keys volition last encrypted amongst a per-user key-encryption master copy key. We'll hash out fundamental protection inwards item later.

Android 4.3 implementation

This hardware-backed pattern was without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been initially implemented inwards the original Jelly Bean unloosen (4.1), thus what's novel here? Credential storage has traditionally (since the Donut days), been implemented every bit a native keystore daemon that used a local socket every bit its IPC interface. The daemon has finally been retired together with replaced amongst a 'real' Binder service, which implements the IKeyStoreService interface. What's interesting hither is that the service is implemented inwards C++, which is somewhat rare inwards Android. See the interface Definition for details, but compared to the original keymaster-based implementation, IKeyStoreService gets iv novel operations: getmtime(), duplicate(), is_hardware_backed() together with clear_uid(). As expected, getmtime() returns the fundamental modification fourth dimension together with duplicate() copies a fundamental blob (used internally for fundamental migration). is_hardware_backed volition enquiry the underlying keymaster implementation together with render true when it is hardware-backed. The finally novel operation, clear_uid(), is a flake to a greater extent than interesting. As nosotros mentioned, the fundamental shop at nowadays supports multi-user devices together with each user gets their ain laid of keys, stored inwards /data/misc/keystore/user_N, where N is the Android user ID. Keys names (aliases) are mapped to filenames every bit before, together with the possessor app UID at nowadays reflects the Android user ID every bit well. When an app that owns fundamental store-managed keys is uninstalled for a user, only keys created past times that user are deleted. If an app is completely removed from the system, its keys are deleted for all users. Since fundamental access is tied to the app UID, this prevents a different app that happens to larn the same UID from accessing an uninstalled app's keys. Key shop reset, which deletes both fundamental files together with the master copy key, also affects only the electrical current user. Here's how fundamental files for the primary user mightiness facial expression like:

1000_CACERT_ca 1000_CACERT_cacert 10248_USRCERT_myKey 10248_USRPKEY_myKey 10293_USRCERT_rsa_key0 10293_USRPKEY_rsa_key0 

The actual files are owned past times the keystore service (which runs every bit the keystore Linux user) together with it checks the calling UID to create upwards one's take heed whether to grant or deny access to a fundamental file, exactly every bit before. If the keys are protected past times hardware, fundamental files may incorporate only a reference to the actual fundamental together with deleting them may non destroy the underlying keys. Therefore, the del_key() functioning is optional together with may non last implemented.

The hardware inwards 'hardware-backed'

To give some perspective to the whole 'hardware-backed' idea, let's briefly hash out how it is implemented on the Nexus 4. As y'all may now, the Nexus iv is based on Qualcomm's Snapdragon S4 Pro APQ8064 SoC. Like most recent ARM SoC's it is TrustZone-enabled together with Qualcomm implement their Secure Execution Environment (QSEE) on top of it. Details are, every bit usual, quite scarce, but trusted application are separated from the primary OS together with the only way to interact amongst them is through the controlled interface the /dev/qseecom device provides. Android applications that wishing to interact amongst the QSEE charge the proprietary libQSEEComAPI.so library together with usage the functions it provides to transportation 'commands' to the QSEE. As amongst most other SEEs, the QSEECom communication API is quite low-level together with basically only allows for exchanging binary blobs (typically commands together with replies), whose contents alone depends on the secure app y'all are communicating with. In the instance of the Nexus iv keymaster, the used commands are: GENERATE_KEYPAIR, IMPORT_KEYPAIR, SIGN_DATA together with VERIFY_DATA. The keymaster implementation simply creates command structures, sends them via the QSEECom API together with parses the replies. It does non incorporate whatever cryptographic code itself.

An interesting item is that, the QSEE keystore trusted app (which may non last a dedicated app, but component subdivision of to a greater extent than full general purpose trusted application) doesn't render uncomplicated references to protected keys, but instead uses proprietary encrypted fundamental blobs (not different nCipher Thales HSMs). In this model, the only thing that is truly protected past times hardware is some cast of 'master' key-encryption fundamental (KEK), together with user-generated keys are only indirectly protected past times beingness encrypted amongst the KEK. This allows for practically unlimited release of protected keys, but has the disadvantage that if the KEK is compromised, all externally stored fundamental blobs are compromised every bit good (of course, the actual implementation mightiness generate a dedicated KEK for each fundamental blob created or the fundamental tin give the sack last fused inwards hardware; either way no details are available). Qualcomm keymaster fundamental blobs are defined inwards AOSP code every bit shown below. This propose that soul exponents are encrypted using AES, most in all likelihood inwards CBC mode, amongst an added HMAC-SHA256 to cheque encrypted information integrity. Those mightiness last farther encrypted amongst the Android fundamental shop master copy fundamental when stored on disk.

#define KM_MAGIC_NUM     (0x4B4D4B42)    /* "KMKB" Key Master Key Blob inwards hex */ #define KM_KEY_SIZE_MAX  (512)           /* 4096 bits */ #define KM_IV_LENGTH     (16)            /* AES128 CBC IV */ #define KM_HMAC_LENGTH   (32)            /* SHA2 volition last used for HMAC  */  struct  qcom_km_key_blob {   uint32_t magic_num;   uint32_t version_num;   uint8_t  modulus[KM_KEY_SIZE_MAX];   uint32_t modulus_size;   uint8_t  public_exponent[KM_KEY_SIZE_MAX];   uint32_t public_exponent_size;   uint8_t  iv[KM_IV_LENGTH];   uint8_t  encrypted_private_exponent[KM_KEY_SIZE_MAX];   uint32_t encrypted_private_exponent_size;   uint8_t  hmac[KM_HMAC_LENGTH]; }; 

So, inwards the instance of the Nexus 4, the 'hardware' is simply the ARM SoC. Are other implementations possible? Theoretically, a hardware-backed keymaster implementation does non quest to last based on TrustZone. Any dedicated device that tin give the sack generate together with shop keys securely tin give the sack last used, the commons suspects beingness embedded secure elements (SE) together with TPMs. However, at that topographic point are no mainstream Android devices amongst dedicated TPMs together with recent flagship devices accept began transportation without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been found. And since they run inside the Secure World they tin give the sack effectively access everything on the device, including other trusted applications. When exploited, this could Pb to real effective together with difficult to observe rootkits. To amount this up, spell TrustZone secure applications mightiness supply effective protection against Android malware running on the device, given physical access, they, every bit good every bit the TrustZone kernel, are exploitable themselves. Applied to the Android fundamental store, this agency that if at that topographic point is an exploitable vulnerability inwards whatever of the underlying trusted applications the keymaster module depends on, key-encryption keys could last extracted together with 'hardware-backed' keys could last compromised.

Advanced usage

As nosotros mentioned inwards the kickoff section, Android 4.3 offers a good defined world API to the organisation fundamental store. It should last sufficient for most usage cases, but if needed y'all tin give the sack connect to the keystore service straight (as always, non truly recommended). Because it is non component subdivision of the Android SDK, the IKeyStoreService doesn't accept wrapper 'Manager' class, thus if y'all desire to larn a receive to it, y'all quest to larn 1 straight from the ServiceManager. That likewise is hidden from SDK apps, but, every bit usual, y'all tin give the sack usage reflection. From there, it's exactly a thing of calling the interface methods y'all quest (see sample project on Github). Of course, if the calling UID doesn't accept the necessary permission, access volition last denied, but most operations are available to all apps.

Class smClass = Class.forName("android.os.ServiceManager"); Method getService = smClass.getMethod("getService", String.class); IBinder binder = (IBinder) getService.invoke(null, "android.security.keystore"); IKeystoreService keystore = IKeystoreService.Stub.asInterface(binder); 

By using the IKeyStoreService straight y'all tin give the sack shop symmetric keys or other hugger-mugger information inwards the organisation fundamental shop past times using the put() method, which the electrical current java.security.KeyStore implementation does non allow (it tin give the sack only shop PrivateKey's). Such information is only encrypted past times the fundamental shop master copy key, together with fifty-fifty the organisation fundamental shop is hardware-backed, information is non protected past times hardware inwards whatever way.

Accessing hidden services is non the only way to augment the organisation fundamental shop functionality. Since the sign() operation implements a 'raw' signature functioning (RSASP1 inwards RFC 3447), fundamental store-managed (including hardware-backed) keys tin give the sack last used to implement signature algorithms non natively supported past times Android. You don't quest to usage the IKeyStoreService interface, because this functioning is available through the touchstone JCE Cipher interface:

KeyStore ks = KeyStore.getInstance("AndroidKeyStore"); ks.load(null); KeyStore.Entry keyEntry = keyStore.getEntry("key1", null); RSAPrivteKey privKey = (RSAPrivateKey)  keyEntry.getPrivateKey();  Cipher c = Cipher.getInstance("RSA/ECB/NoPadding"); cipher.init(Cipher.ENCRYPT_MODE, i privateKey); byte[] outcome = cipher.doFinal(in, o, in.length); 

If y'all usage this primitive to implement, for example, Bouncy Castle's AsymmetricBlockCipher interface, y'all tin give the sack usage whatever signature algorithm available inwards the Bouncy Castle lightweight API (we truly usage Spongy Castle to remain compatible amongst Android 2.x without likewise much hastle). For example, if y'all desire to usage a to a greater extent than modern (and provably secure) signature algorithm than Android's default PKCS#1.5 implementation, such every bit RSA-PSS y'all tin give the sack attain it amongst something similar this (see sample project for AndroidRsaEngine):

AndroidRsaEngine rsa = novel AndroidRsaEngine("key1", true);  Digest digest = novel SHA512Digest(); Digest mgf1digest = novel SHA512Digest(); PSSSigner signer = novel PSSSigner(rsa, digest, mgf1digest, 512 / 8); RSAKeyParameters params = novel RSAKeyParameters(false,                     pubKey.getModulus(), pubKey.getPublicExponent());  signer.init(true, params); signer.update(signedData, 0, signedData.length); byte[] signature = signer.generateSignature(); 

Likewise, if y'all quest to implement RSA fundamental exchange, y'all tin give the sack easily laid upwards usage of OAEP padding similar this:

AndroidRsaEngine rsa = novel AndroidRsaEngine("key1", false);  Digest digest = novel SHA512Digest(); Digest mgf1digest = novel SHA512Digest(); OAEPEncoding oaep = novel OAEPEncoding(rsa, digest, mgf1digest, null);  oaep.init(true, null); byte[] cipherText = oaep.processBlock(plainBytes, 0, plainBytes.length); 

The sample application shows how to necktie all of those APIs together together with features an elegant together with fully Holo-compatible user interface:



An added practice goodness of using hardware-backed keys is that, since they are non generated using Android's default SecureRandom implementation, they should non last affected past times the latterly announced without embedded SEs, most in all likelihood due to carrier pressure level (price is hardly a factor, since embedded SEs are unremarkably inwards the same bundle every bit the NFC controller). Of course, all mobile devices accept some cast of UICC (SIM card), which typically tin give the sack generate together with shop keys, thus why non usage that? Well, Android however doesn't accept a touchstone API to access the UICC, fifty-fifty though 'vendor' firmwares oft include one. So spell 1 could theoretically implement a UICC-based keymaster module compatible amongst the UICC's of your friendly neighbourhood MNO, it is non real probable to happen.

Security level

So how secure are y'all laid upwards novel hardware-backed keys? The response is, every bit usual, it depends. If they are stored inwards a real, dedicated, tamper-resistant hardware module, such every bit an embedded SE, they are every bit secure every bit the SE. And since this technology scientific discipline has been around for over xl years, together with fifty-fifty recent attacks are only effective against SEs using weak encryption algorithms, that agency fairly secure. Of course, every bit nosotros mentioned inwards the previous section, at that topographic point are no electrical current keymaster implementations that usage actual SEs, but nosotros tin give the sack only hope.

What nigh TrustZone? It is beingness aggressively marketed as a mobile safety 'silver bullet' together with streaming media companies accept embraced it every bit an 'end-to-end' DRM solution, but does it truly deliver? While the ARM TrustZone architecture mightiness last audio at its core, inwards the destination trusted applications are exactly software that runs at a slightly lower grade than Android. As such, they tin give the sack last readily opposite engineered, together with of course of didactics vulnerabilities accept been SecureRandom vulnerability (of course, since the implementation is closed, nosotros tin give the sack only hope that trusted apps' RNG truly works...). However, Bouncy Castle's PSS together with OAEP implementations practice usage SecureRandom internally, thus y'all mightiness desire to seed the PRNG 'manually' earlier starting your app to laid upwards certainly it doesn't start amongst the same PRNG nation every bit other apps. The keystore daemon/service uses /dev/urandom straight every bit a source of randomness, when generating master copy keys used for fundamental file encryption, thus they should non last affected. RSA keys generated past times the softkeymaster OpenSSL-based software implementation mightiness last affected, because OpenSSL uses RAND_bytes() to generate primes, but are in all likelihood OK since the keystore daemon/service runs inwards a dedicated procedure together with the OpenSSL PRNG automatically seeds itself from /dev/urandom on kickoff access (unfortunately at that topographic point are no official details nigh the 'insecure SecureRandom' problem, thus nosotros can't last certain).

Summary

Android 4.3 offers a touchstone SDK API for generating together with accessing app-private RSA keys, which makes it easier for non-system apps to shop their keys securely, without implementing fundamental protection themselves. The novel Jelly Bean also offers hardware-backed fundamental storage on supported devices, which guarantees that fifty-fifty organisation or root apps cannot extract the keys. Protection against physical access attacks depends on the implementation, amongst most (all?) electrical current implementations beingness TrustZone-based. Low-level RSA operations amongst fundamental shop managed keys are also possible, which enables apps to usage cryptographic algorithms non provided past times Android's built-in JCE providers.

0 Komentar untuk "Droidcedas : Credential Storage Enhancements Inwards Android 4.3"

Back To Top