CogniCryptgen: Generating code for the secure usage of crypto APIs

Stefan Kruger, Karim Ali, Eric Bodden

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Many software applications are insecure because they misuse cryptographic APIs. Prior attempts to address misuses focused on detecting them after the fact. However, avoiding such misuses in the first place would significantly reduce development cost. In this paper,we present CogniCryptgen, a code generator that proactively assists developers in using Java crypto APIs correctly. CogniCryptgen accepts as input a code template and API-usage rules defined in the specification language CrySL. The code templates in CogniCryptgen are minimal, only comprising simple glue code. All security-sensitive code is generated fully automatically from the CrySL rules that the templates merely refer to. That way, generated code is provably correct and secure with respect to the CrySL definitions. CogniCryptgen supports the implementation of the most common cryptographic use cases, ranging from password-based encryption to digital signatures. We have empirically evaluated CogniCryptgen from the perspectives of both crypto-API developers and application developers. Our results show that CogniCryptgen is fast enough to be used during development. Compared to a stateof- the-art template-based solution, implementing use cases with CogniCryptgen requires only a fourth of development effort, without any additional language skills. Real-world developers see CogniCryptgen as significantly simpler to use than the same template-based solution.

Original languageEnglish (US)
Title of host publicationCGO 2020 - Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization
EditorsJason Mars, Lingjia Tang, Jingling Xue, Peng Wu
PublisherAssociation for Computing Machinery, Inc
Pages185-198
Number of pages14
ISBN (Electronic)9781450370479
DOIs
StatePublished - Feb 22 2020
Event18th ACM/IEEE International Symposium on Code Generation and Optimization, CGO 2020 - San Diego, United States
Duration: Feb 22 2020Feb 26 2020

Publication series

NameCGO 2020 - Proceedings of the 18th ACM/IEEE International Symposium on Code Generation and Optimization

Conference

Conference18th ACM/IEEE International Symposium on Code Generation and Optimization, CGO 2020
Country/TerritoryUnited States
CitySan Diego
Period2/22/202/26/20

Keywords

  • Code Generation
  • Code Templates
  • Cryptographic Misuse
  • Security Specifications

ASJC Scopus subject areas

  • Applied Mathematics
  • Computer Science Applications
  • Control and Optimization
  • Computational Theory and Mathematics

Fingerprint

Dive into the research topics of 'CogniCryptgen: Generating code for the secure usage of crypto APIs'. Together they form a unique fingerprint.

Cite this