BLOG
Table of Content
- Posted on: Jan 27, 2022
- By Subho Halder
- 5 Mins Read
- Last updated on: Sep 17, 2024
Cryptography is the next-gen solution to resolve the concern of heinous and sophisticated crimes.
During penetration tests, testers (or attackers) can access the source code and the system's inner workings. Passing a white-box test is more complex and requires a higher level of security than a black-box test, in which the attacker can only see the system from the outside. Whitebox crypto is appropriately named because attackers have access to compiled code where the keys are located. The difficult problem it tries to solve is keeping these keys safe while you use them during operation.
White-box cryptography is the new technique against attacks in white-box attack environments. The attacker is even stronger in the white-box attack model than in the black-box attack model, as they can monitor all values by using one of his methods to hide the key in the look-up tables. The attacker cannot find the secret key in the physical memory because it is not directly visible.
Therefore, white-box cryptography is used to ensure a high level of security.
What is white-box cryptography?
Whitebox cryptography is a powerful solution that protects secret keys from disclosure in software implementations. It is essentially a way of protecting software implementations of different cryptographic algorithms from other types of vulnerabilities.
Whitebox cryptography combines encryption and obfuscation methods to embed secret keys in application code. The aim is to combine code and key so that an attacker cannot distinguish between the two, and the new "white-box" program can be safely executed in an insecure environment.
Whitebox cryptography is essential to application developers as it helps minimize security risks for various devices.
For example, different end devices have to be protected to make payments so that the perpetrator cannot access confidential information. White-box cryptography is designed to avoid this disclosure since the keys are stored here randomly as data and code.
What is the Kerckhoff principle?
The Kerckhoff principle states that a cryptosystem's security must lie solely in the choice of its keys; everything else (including the algorithm itself) should be considered public knowledge.
Kerckhoff's article looked at solutions for contemporary military cryptography from a practical perspective and established six design principles for military ciphers:
1. The system must be practically, if not mathematically, indecipherable.
2. The system should not have to be secret, and it should be able to fall into the hands of an enemy without inconvenience.
3. The system encryption key must be saved and transmitted without written notes, and it must be possible to change or modify it at the discretion of the communicating parties.
4. The system must be applicable to telegraph communications (the predominant technology at the time).
5. The system's devices and documents must be portable, and their use and operation must not require the gathering or cooperation of several people.
6. The system must be easy to use and does not require mental exertion or knowledge of a long set of rules for its implementation.
The Kerckhoff principle has revolutionized the way we think about crypto. It states that we must allow the attacker to learn everything about a cryptography implementation except the key. If a cryptosystem can stand this test, it is better.
Whitebox crypto goes one step further. Technically, we give the attacker access to the key, but we only hide/encrypt it so well that he cannot find it.
How does white-box cryptography work?
In this model, the attacker has complete control over the execution environment of the targets, assuming that:
- Fully privileged attacks have full access to the deployment algorithms.
- The dynamic execution can be observed, and important data such as cryptographic keys can be viewed.
- Detailed system algorithms are fully visible and modifiable.
To successfully hide the keys in this scenario, according to Brecht Wyseur, we can take the following steps when we try to white-box a block cipher:
Partial evaluation
When executing a trade, we modify the trade based on the key code. For example, in the replacement phase of a block cipher, we would change the look-up table to be key-dependent. Note that someone seeing this table could infer the key.
Tabularization
It transforms all other operations to use look-up tables, which can describe any function.
Randomization and delinearization
We create an encoded sequence of look-up tables with the same functionality as the original string but hides the key. With this new string, we now have a disguised algorithm.
White-box vs black-box cryptography
The attack contexts for the crypto module can be divided into black box, gray box, and white box attacks. The white box attack is considered the strongest, and the opponent has all privileges and access to the algorithm's implementation and dynamic execution.
In the "gray box" model, the attacker also has access to partial information from the side channel; This is where performance analysis comes into play. With the “white box” model, the attacker has full access to the internal status. The white box model is intended for the algorithm to run as software on the attacker's computer.
White-box cryptography has proven to be more suitable than black-box and gray-box cryptography. In the “black box” model, the security of a cryptographic algorithm is examined. With symmetrical encryption, for example, the attacker has access to a “device” that executes the encryption algorithm with a specific key.
Uses of white-Box cryptography in applications
In most cases, white-box cryptography is implemented to protect cryptographic implementations in various applications running on open devices such as smartphones, PCs, and tablets when the developer needs to achieve the highest level of security without relying on secure hardware elements.
Various software applications store and process private and confidential data and can benefit significantly from white-box cryptography. In some industries, it is an integral part of your security policy. Some of the specific application examples are discussed below.
1. Contactless payments with NFC
Today, several mobile payment applications use Near Field Communication (NFC) technology to turn conventional phones into contactless payment terminals. These can be crucial for companies, especially those with limited resources, to invest in specialized point-of-sale systems. However, one of the main issues here is still security.
2. Medical applications
Most data on medical devices is encrypted and sent using strong encryption. In addition, this medical data can be signed to ensure its integrity.
Usually, a key is safe within the confines of a medical device and on both cloud servers. Applications or programs running on your smartphone or desktop PC are the weakest links in terms of security.
In this case, white-box cryptography helps secure both the decryption and the signing of keys, guaranteeing the security of medical data/records against theft or manipulation by attackers.
3. OTT platforms
The rapid rise of OTT, or above-ground video services, has led those in charge to protect video from hackers while ensuring easy access and a user-friendly experience: streamlined display for paying customers. It applies to both applications and set-top boxes OTT service providers use to provide content.
4. Secure digital signatures
Digital signatures are normally used for security as they facilitate undeniable user consent, even for remote entity authentication. In Europe, electronic signatures must have signing keys embedded into a trusted piece of hardware, such as certified smart cards, until 2016. Now, digital signatures are legalized, and any trusted hardware is not required.
Initiatives like these have opened avenues for software-only signature generation for remote access control, contract signing, etc.
Adopting the white-box approach to digital signatures will protect all parties involved against identity theft and voluntary sharing of access rights.
How does white cryptography prevent reverse engineering?
Reverse engineering has many practical uses in software development and identifying underlying security issues. However, hackers also utilize it for malicious practices, such as malware and security breaches.
Whitebox cryptography resists reverse engineering threats by using cryptographic keys to preserve code. It can be used to create reverse-engineering detection tools and anti-tamper technology to prevent app reverse engineering.
Conclusion
Whitebox cryptography is an excellent solution for protecting against various application vulnerabilities. Although there is still much room for improvement, it has shown great potential in protecting various applications from hackers.
FAQs
1. What common cryptographic feature is an aspect of white-box cryptography where keys are protected from extraction when controlled by the penetration tester or attacker?
The keys are protected from extraction with obfuscation.
2. How secure is cryptography?
Cryptography helps authenticate senders and recipients to one another and protects against repudiation. Moreover, it can ensure the confidentiality and integrity of both data in transit and at rest.
Subho Halder
Subscribe now for growth-boosting insights from Appknox
We have so many ideas for new features that can help your mobile app security even more efficiently. We promise you that we wont mail bomb you, just once in a month.