Method SecureKey():generate() Professional

Creates an instance of the SecureKey class holding a generated key.

This optional parameter determines the length of the key in bit. The default value is 128. Values must be multiples of eight.

The class method :generate() returns an SecureKey object.


The level of security not only depends on the length of the key but also very much quality of the key. For example, if a key length of 128 bit is choosen, all of thes 128 bits should be "used". It makes no sense to use a key like "hi" (or 0x68, 0x69) and to fill the remaining 108 bits with zero. It would be, of course, a valid element of the possible key set but is faster to crack, as soon as the true key length is detected. This is referred to as the densitiy of information (also known as Entropy) of the key, and it should be as high as possible.

Using generated keys rises the level of security because all bits of the key will be used, and, of course, generated keys usually don't include verbal words of a language.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.