Cryptographic lint tools

Cryptographic lint tools





In the last post I wrote about a tool called CryptoLint which uses static analysis and program slicing to asses the behavior of cryptographic primitives and estimate their proper usage. Since then I have been researching whether the work has been continued or was something similar produced and improved. Searching for this I have stumbled upon few works which have used the same idea of evaluation to find misuses of cryptographic primitives and have added additional features to their tools. Regardless of idea they have not necessarily used same approach during the analysis.

First tool Ive found was Amandroid which is inter-component data flow analysis framework. This tool preforms detailed analysis of Android bytecode to create inter-procedural control flow graph (ICFG) and inter-component data flow graph (IDFG) to capture inter-component communication on which Android is strongly depended on. From IDFG Amandroid creates data dependence graph (DDG) of the application. Afterwards from querying these graphs Amandroid is capable of checking a variety of security problems as data leaks and data injections, also the work has demonstrated that Amandroid can be set up to work as CryptoLint and evalute set of rules I mentioned in the previous post. Amandroid is not a specialized tool but a more general framework which can be upgraded to perform automatic analysis and its source is available online.

The most similar work Ive found was CDRep (Cryptographic � Misuses Detection and Repair) tool which uses apktool to decompile applications and has added functionality to repair found mistakes. It directly builds upon CryptoLint tool using the same mechanics and rule set to detect misuses in cryptographic primitives and it also adds additional rule not to use reversible one-way hash. The idea to add this rule was from previous work which demostrated tool called Crypto Misuse Analyser (CMA). CMA was also inspired by CryptoLint tool. CMA, CDRep and CryptoLint all depend on detecting invocations of cryptographic APIs. Afterwards CMA runs the application and records cryptographic calls from which it evaluates on the rule based model similarly to previous work. In CDRep research this added rule was the most commonly broken because of the usage of MD5 hash function. CDRep detects and repairs applications by analyzing bytecode. The repairment is based on generic patch templates which are manually made based on common solutions for each broken rule. After the rule broken is detected the corresponding template is applied to fix the misuse. The template directs series of transformations which change faulty programs to correct ones with high success rate. Considering range of detection same limitation exist as in CryptoLint.

We can find similar work outside Android platform, for instance iCryptoTracer for iOS applications. This tool combines static and dynamic analysis to trace iOS application�s usage of cryptographic APIs. It then extracts the trace log and evaluates whether cryptographic rules are obeyed. Also there is PyCrypto_Lint tool based on CryptoLint but focusing on misuse of PyCrypto library and runtime source analysis to create more helpful tool for development process.

CryptoLint and tools alike are just one example to detect misuse in usage of cryptographic primitives. There are several approaches on how exactly decompile and extract information about classes and cryptographic functions from Android bytecode and other platforms. Depending on how detailed analysis is done it will influence how broad the rule set can be applied and how well mistakes can be detected. But also with increasing complexity the duration of runtime is necessary to take into consideration.

For further work I plan to research more thoroughly Amandroid framework, how it works, what are its capabilities and how well can it be used to reimplement a tool like CryptoLint.

download file now