In the world of heinous and sophisticated crimes, cryptography is the next-gen solution needed to resolve the concern. Whitebox cryptography combines encryption and obfuscation methods to embed secret keys in application code. The aim is to combine code and key in such a way that an attacker cannot distinguish between the two and the new "white-box" program can be safely executed in an insecure environment.
White-box cryptography is the new technique against attacks in white box attack environments. In the white box attack model, the attacker is even stronger than in the black box attack model, and the attacker 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 in the memory.
Therefore, Whitebox cryptography is used to ensure a high level of security.
What does White-box Cryptography mean?
During the penetration test, testers (or attackers) have access to the source code and the inner workings of the system. Passing a white box test is more difficult 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 how to keep these keys safe while you use them during operation.
Whitebox cryptography is a powerful solution that aims to protect secret keys from disclosure in a software implementation. It is essentially a way of protecting software implementations of different cryptographic algorithms from different types of vulnerabilities. It combines encryption and obfuscation methods to embed key secrets in the application code.
The main goal of white-box cryptography is to bring code and keys together in a unique way and to make them indistinguishable to a hacker/attacker so that the resulting program can run securely in an insecure environment.
Whitebox cryptography is particularly important to application developers as it helps them 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.
The Kerckhoffs principle states that the security of a cryptosystem 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 at least 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) It must be possible to save and transmit the system encryption key 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 devices and documents of the system 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 Kerckhoffs principle has revolutionized the way we think about crypto. It says that we have to allow the attacker to learn everything about a cryptography implementation, except the key. If a cryptosystem can stand this test, it is better for it.
Whitebox crypto goes one step further, i.e., technically we give the attacker access to the key, we only hide/encrypt it so well that he cannot find it.
Must Read: 5 Ways Your Cryptocurrency May be Hacked
How does White-box Cryptography work?
In this model, the attacker has full 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: Transforms all other operations to also use look-up tables. This is possible because look-up tables can describe any function.
Randomization and Delinearization: We create an encoded sequence of look-up tables that has 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 the black box, gray box, and white box attacks, whereby the white-box attack is considered the strongest attack and the opponent has all privileges and also access to the implementation of the algorithm and its 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 runs as software on the attacker's computer.
White box cryptography has proven to be more suitable than black box and gray box cryptography. The security of a cryptographic algorithm is examined in the “black box” model: 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 elements of secure hardware being.
Various software applications store and process private and confidential data and can benefit greatly from white-box cryptography. In some industries, it is even 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.
Whitebox cryptography helps, in this case, to secure both the decryption and the signing of keys and thus to guarantee 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 the problem of protecting 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 used by OTT service providers to provide content.
4. Secure Digital Signatures
Normally, digital signatures are used for security purposes as they facilitate undeniable user consent even for remote entity authentication. In Europe, electronic signatures are required to 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 in the digital signature will now protect all the parties involved against identity theft and voluntary sharing of access rights.
How Whitebox Cryptography Prevents Reverse Engineering
Reverse engineering finds many practical uses in software development and identifying any underlying security issues. However, it is also utilized by hackers for malicious practices, such as malware and security breaches.
Whitebox cryptography resists reverse engineering threats by using cryptographic keys for code preservation. Whitebox cryptography can be used to create reverse-engineering detection tools and anti-tamper technology for preventing reverse engineering of apps.
In association with encryption methods the white-box cryptography for safeguarding devices and applications for the diverse use cases, such as:
- Mobile payments
- Medical industry tools
- Content streaming
Whitebox cryptography is a great solution for protecting against different types of application vulnerabilities. There is still a lot of room for improvement, but now it has shown great potential in protecting various applications from hackers.