A password-based key derivation algorithm using the kbrp method

This study presents a new efficient password-based strong key derivation algorithm using the key based random permutation the KBRP method. The algorithm consists of five steps, the first three steps are similar to those formed the KBRP method. The last two steps are added to derive a key and to ensure that the derived key has all the characteristics of a strong key. In order to demonstrate the efficiency of the algorithm, a number of keys are derived using various passwords of different content and length. The features of the derived keys show a good agreement with all characteristics of strong keys. In addition, they are compared with features of keys generated using the WLAN strong key generator v2.2 by Warewolf Labs.

• The key size must be long enough so that it can not be easily broken • The key should have the highest possible entropy (close to unity) • Run length should be less than eight bits (a character word length) • Bits are randomly distributed throughout the key sequence • No particular pattern can be recognized throughout the key sequence Hash function and pseudorandom function are widely used for key derivation. These two functional approaches are used in PBKDF1 and PBKDF2, respectively. PBKDF2 is recommended for new applications while PBKDF1 is included only for compatibility with existing applications and is not recommended for new applications (Kal 00). A wired equivalent privacy or wireless encryption protocol (WEP) is another functional approach that is developed to provide security for wireless networks. However, a number of techniques and programs are now available that can crack a WEP key in less than a minute. Despite that a wireless strong key generator has been developed to enhance wireless security such as the WLAN strong key generator v2.2 by Warewolf Labs [14] .
In this study a new efficient password-based key derivation algorithm is proposed for a strong key derivation, regardless of the password elements and length. The algorithm utilizes the Key Based Random Permutation (KBRP) method in [15] . In order to ensure that the binary sequence generated is hard to predict, first, an important modification is introduced to the last step in KBRP, namely the fill () step. Second, two further steps are added to the KBRP method to derive a strong key.
The modified KBRP method assures that the key derived is of highest possible entropy (close to unity, since the number of 0's and 1's are only differing by 1). But the derived key may not provide an adequate run length for 0's and 1's. Therefore, in order to satisfy a suitable run length (RL) of 0's and 1's, we march through the derived key and every time the run length is greater than RL, then the last bit in RL is replaced with the subsequent bit that represents its complement.
This algorithm ensures even with weak password, a strong key can be derived to satisfy the characteristics mentioned above. So that user can still use their favorite password set without affecting the key strength.
The features of the keys generated using the proposed algorithm are evaluated, analyzed and compared with the results obtained from the WLAN strong key generator v2.2 by Wareworlf Labs. The features evaluation process is done by comparing the entropy of the derived key, maximum run length of 0's and 1's and the average run length.

LITERATURE REVIEW
A number of key derivation approaches have been developed throughout the years, such as: functional based [2,5,6] , biometric based [7,8,9] and voice based [10,11,12] . B. Kaliski [2] proposed a functional based approach to derive a key from a password and other parameters such as a salt value and an iteration count. He developed two functions for key derivation, namely, PBKDF1 and PBKDF2. PBKDF2 is recommended for new applications; PBKDF1 is included only for compatibility with existing applications and is not recommended for new applications.
He defined four steps in his key derivation functions. These are: (1) select a salt value and an iteration count, (2) select a length in octets for the derived key, (3) apply the key derivation function to the password, the salt, the iteration count and the key length to produce a derived key and (4) output the derived key. In this approach, many numbers of keys may be derived from a password by varying the salt.
Costanzo [7] proposed a biometric key derivation approach for generating a cryptographic key from an individual's biometric for use in proven symmetric cipher algorithms. The proposed approach uses a method referred to as Biometric Aggregation. In this approach, the encryption process begins with the acquisition of the required biometric samples. Features and parameters are extracted from these samples and used to derive a biometric key that can be used to encrypt a plaintext message and its header information. During the decryption process, acquisition of additional biometric samples from which the same features and parameters are extracted and used to produce a "noisy" key as done in the encryption process. Next, a small set of permutations of the "noisy" key are computed. These keys are used to decrypt the header information and determine the validity of the key. If the header is determined to be valid, then the rest of the message is decrypted. The proposed approach eliminates the need for biometric matching algorithms, reduces the cost associated with lost keys and addresses non-repudiation issues.
Monrose et al. [11,12] developed a technique to reliably generate a cryptographic key from a user's voice while speaking a password. The key resists cryptanalysis even against an attacker who captures all system information related to generating or verifying the cryptographic key. Moreover, the technique is sufficiently robust to enable the user to reliably regenerate the key by uttering the password again. They described an empirical evaluation of their technique using 250 utterances recorded from 50 users.
Teoh [9] proposed a novel two-stage technique to generate personalized cryptographic keys from the face biometric, which offers the inextricably link to its owner. At the first stage, integral transform of biometric input is to discretise to produce a set of bit representation with a set of tokenised pseudorandom number, coined as FaceHash. In the second stage, FaceHash is then securely reduced to a single cryptographic key via Shamir secret-sharing. Tokenised FaceHashing is rigorously protective of the face data, with security comparable to cryptographic hashing of token and knowledge key-factor. The key is constructed to resist cryptanalysis even against an adversary who captures the user device or the feature descriptor.
Peyravian et al. [16] used either a 'user Identifier' (userID) or information that may be used to identify the individual such as a user's biometric data. These data can be the user's fingerprints, hand geometry, iris pattern, or any other suitable biometric identification. Then such user ID-based or biometric-based key or random number generated based on their algorithms may be used in asymmetric-key cryptographic systems (such as the RSA) or the symmetric-key cryptographic systems (such as the DES).

THE PROPOSED KEY DERIVATION ALGORITHM
Here we present a description of the proposed key derivation algorithm. It utilizes the KBRP method [15] ; therefore, we first provide a brief description of this method followed by a detail implementation of the proposed algorithm.

KBRP METHOD
Key Based Random Permutation (KBRP) is a method that generates one permutation of size N out of N! permutations [15] . This permutation is generated from a certain key (password) by considering all elements of the password in the generation process. The permutation is stored in one-dimensional array, P, of size N. The KBRP method consists of three consecutive steps: init (), eliminate () and fill ().
The first step, init (), initializes an array of size N with elements from the given password. It takes the ASCII code of each element in the password and storing them in the array consecutively. If the password provides less than N elements, the unfilled elements are derived by adding two consecutive values, starting at the first element of the array until all unfilled elements are set to values. Finally, the mod operation with respect to N+1 is calculated for each element, so that all values are set within the range 1 to N.
The second step, eliminate (), is to eliminate the similar values by replacing them with zero and keep only one value out of these similar values. Last step, fill (), is to replace all zero values with values in the range 1 to N that are not exist in the array. The resulted array is now representing the permutation.

THE PASSWORD-BASED KEY DERIVATION ALGORITHM
The proposed algorithm consists of five steps. These are: init (), eliminate (), fill (), derive () and certify (). The first three steps are similar to those in the KBRP method explained above.
The forth step, derive (), derives the key from the permutation P generated from the KBRP method by performing mod 2 operation for each element in P. This ensures that each element in P will have either 0 or 1 and the number of 0's and 1's are even, since N is always an even number. To satisfy one of the requirements of a strong key by do not use an equal number of 0's and 1's, we invert one or more bits of the same value. These bits can be selected randomly or according to a particular procedure. However, in our  algorithm, in order to obtain the highest acceptable entropy (close to unity), only one bit is complimented. This bit is chosen according to the value of the element number one in the permutation array, so that the derived key depends on the password elements entered and different keys can be derived depending on the position of inverted bit. The drive () step is performed to ensure that bits are randomly distributed throughout the binary key sequence. Figure 1 outlines the procedure of the key derivation step. However, this step will not ensure that the derived key satisfies the run length requirement for a strong key. For this reason, we use step 5 to certify the key.
The fifth step, certify (), takes the outcome of the forth step and check the run length for the two binary digits 0 and 1 to make sure that the run length for each of them is not more than a particular value, r. To achieve this objective without varying the entropy, the binary sequence is checked and once the run length equal to r, the r th +1 bit is swapped with its next complement bit (here we use r = 4). Fig. 2, shows the algorithm for the certify () step.

ILLUSTRATIVE EXAMPLES
The five steps forming the proposed algorithm are implemented in a small code using C++ language. The code takes as an input any character set (password) and output a binary key that has all features of a strong key; such a highest possible entropy, a run length of both 0's and 1's is less than or equal to r (4<r<8). In addition, no pattern can be recognized throughout the entire key and a minimum number of repetitions are allowed for any sub set of the binary sequence within the key. In particular, the code calculates a number of parameters such as: entropy of the key, the number of 0's and 1's and the minimum, maximum and average run length for both 0's and 1's.
In order to demonstrate the efficiency of the new algorithm in deriving strong keys, we present the results for the key derived for five different initial passwords, these are: The results for 40, 104, 128 and 232 bits key lengths are presented in Table 1-4, respectively. The derived keys are compared with those obtained from the WLAN strong key generator program v2.2 by Warewolf Labs [14] in Table 5 The results show that the keys derived using the proposed algorithm always have the maximum acceptable entropy, a controlled run length for both 0's and 1's of not more than a particular value (in this case r=4) for all key lengths and an acceptable average run length. On the other hand, the tests show that for the Warewolf program, the run length may be more than 8 for long keys.

CONCLUSION
This study presents a new functional passwordbased strong key derivation algorithm using the key based random permutation (KBRP) method. The KBRP method consists of three computational steps (init (), eliminate (0 and fill () steps) to generate a permutation P of size N out of N! possible permutations. Two other computational steps (derive () and certify () steps) are added to process the outcome of the KBRP method to derive a key that meets all the features of a strong key. In particular, the derived key has a maximum