28.2 Component Crypt

The topics Encrypt and Decrypt gain importance when you want to protect sensitive data or access to programmes with a password (→ Chapter 28.3 OpenSSl). Gambas provides the component gb.crypt for these applications. The class Crypt allows you to encrypt a password. The methods Crypt.DES and Crypt.MD5 use the DES and MD5 algorithms to encrypt a password string. The Crypt.Check method allows you to compare the encrypted password with an entered (plaintext) password string.

In addition, some projects check whether the password input is a strong password. In my opinion, a strong password can be defined like this:

B1
Figure 28.2.1: Password generator for strong passwords

With the presented password generator PWL8 you can randomly encrypt or decrypt passwords with a character set of your own choice. The encrypted passwords are used, for example, to protect your own Gambas programmes that are used to process sensitive data or to access this sensitive data itself.


Figure 28.2.2: Password generator PWL8

A special role in the context of passwords is played by the entry of the root password, as required for privileged tasks. Different approaches are presented, investigated and implemented in projects.