Securing password using dynamic password policy generator algorithm

Securing password using dynamic password policy generator algorithm

Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx Contents lists available at ScienceDirect Journal of King Saud Un...

449KB Sizes 0 Downloads 91 Views

Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx

Contents lists available at ScienceDirect

Journal of King Saud University – Computer and Information Sciences journal homepage: www.sciencedirect.com

Securing password using dynamic password policy generator algorithm Anuraj Singh ⇑, Sumit Raj ABV – Indian Institute of Information Technology and Management Gwalior, MP, India

a r t i c l e

i n f o

Article history: Received 20 February 2019 Revised 6 May 2019 Accepted 9 June 2019 Available online xxxx

a b s t r a c t It is proposed to tackle the problem of password leakage of popular websites like Linked-In, Adobe, Gmail, Yahoo, eHarmony, etc. by using dynamic password policy and enhanced hash algorithm. Here, an algorithm is developed that will generate password policies dynamically depending on the frequency of characters. Time complexity is computed, and it is found that the algorithm works fast. Since the algorithm creates password policies dynamically, it will be tough for the attacker to guess the characteristics of the password database. Ó 2019 The Authors. Production and hosting by Elsevier B.V. on behalf of King Saud University. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

1. Introduction Most websites use passwords for user authentication and allowing them to access resources of the website that contain sensitive information. Password choices of the user are not very strong and due to this many web users are susceptible to having their information hacked (Kelley et al., 2012; Yee and Sitaker, 2006; Halderman et al., 2005). Generally, people use dictionary words to create a password or any simple password which they can remember (Vykopal et al., 2009). Passwords are put through oneway hash functions, and then they are stored in the database as corresponding hash values instead of plain-text (McKenzie et al., 1990). A potential hacker can use brute-force attack, rainbow table attack, dictionary attack, phishing attack, social engineering attack to retrieve the input password from the hash values and the mostly real-life attacks were done by cracking password hashes using the dictionary attack (Kallapur and Geetha, 2011). Major websites and applications provide security policy along with password-strength measure and users are requested to register in websites with the passwords that follow the password policy (Raikar and Ramarao, 2010). Passwords that follow specific patterns are accepted as strong by the existing policies, but still, they are susceptible for a

⇑ Corresponding author. E-mail address: [email protected] (A. Singh). Peer review under responsibility of King Saud University.

Production and hosting by Elsevier

dictionary attack, rainbow table attack, brute force attack, etc. based on those patterns (Vedula et al., 2012). To secure any information authentication is the most critical requirement. There are various modes of authentication according to the convenience of users such as captcha, PINs, OTP, biometric fingerprints, etc (Ross et al., 2005). Generally, systems based on password are most commonly used and are easy to implement among the existing methods (Zhai and He, 2010). Security of stored passwords is a major issue due to the leakage of passwords from major websites like Linked-In, G-mail, Yahoo, etc (Almeshekah et al., 2015). This leakage of password gave the attackers a lot of datasets to train their password cracking algorithms. Stobert and Biddle resulted that the weak password storage methods are used on many websites based on the recent leakage of passwords (Stobert and Biddle, 2014). In another study, in the e-Harmony system passwords were stored using MD5 hashes without salt and also the Linked-In passwords were stored using SHA-1 algorithm without salt values (Ji et al., 2015). An attacker can perform a fully automated attack to crack the user’s password by comparing hash value to the cryptographic hashes of likely password guesses (Houshmand and Aggarwal, 2012). The offline attacker has limited resources but he/she can try as many password guesses he/she likes. Some password leak incidents have happened to make things worse. Now, the attacker has a large dataset of leaked passwords which can greatly enhance attackers’ capability to crack as many passwords as he can (Blocki and Datta, 2016). Most websites and applications use password strength checker to check the strength of passwords at the time of user registration (Bonneau, 2012). The primary goal of the password strength checker is to guide users to create a secure password, but we have observed and examined that there is a lack of consistency and accuracy in the

https://doi.org/10.1016/j.jksuci.2019.06.006 1319-1578/Ó 2019 The Authors. Production and hosting by Elsevier B.V. on behalf of King Saud University. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).

Please cite this article as: A. Singh and S. Raj, Securing password using dynamic password policy generator algorithm, Journal of King Saud University – Computer and Information Sciences, https://doi.org/10.1016/j.jksuci.2019.06.006

2

A. Singh, S. Raj / Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx

static password strength checker (Castelluccia et al., 2012). The existing password strength checkers do not perform uniform characterization of strong passwords (Hoek et al., 1998). In another study, the investigator found that there is a trade-off between usability and complexity of the password. Also, Complex passwords have less usability. Therefore, password strength checkers cannot demand users to create very complex password (Shay et al., 2010). It is also straightforward to target password strength checker, i.e., password strength checkers can also be a vulnerability. Password strength checker provides a static password policy for every user. As a result, the password generated using this password policy has strong biases on password characteristics (Weir et al., 2009). In this paper, an algorithm is developed to generate password policies dynamically depending on the character frequency in the database. The algorithm creates effective policies which are different for every user. It uses almost all characters in its password space which is generally not used. The password created by the user using the dynamic policy is strong and complex. For an attacker, it is harder to crack those passwords.

2. Analysis 2.1. Popular hashing function MD5 (Message-Digest Algorithm 5) is a simplified cryptographic hash function which generates a 128-bit hash value. MD5 has been used in most of the security applications, and it is also used to verify the integrity of files. The hash of an MD5 is expressed as a 32 digit hexadecimal number. MD5, invented by Professor Ronald Rivest, of MIT is the updated version of MD4 and it is used as the model for SHA-1. SHA-1 and MD5 are the two most commonly used hash algorithms today, but the use of MD5 has been declined over time because it is now considered broken (Wang and Yu, 2005). According to Stevens et al., even SHA-1 is also not safe to use (Stevens et al., 2017). For assurance of security of passwords, developers store salted hash values into their databases instead of plain-text. Attackers can access the entries of the tables within websites’ database

through SQL injection vulnerabilities (Sadeghian et al., 2013). An attacker can use Brute-force attack, Rainbow table attack, Dictionary attack to crack input password plain-text from its hash value (Castelluccia et al., 2013). Most websites and applications insist users add special characters, digits, and symbols to make their password more complex. Houshmand and Aggarwal resulted that some users choose a password by repeating a dictionary word more than once (e.g., proneproneprone, crackcrack, etc.) to make it strong and long (Houshmand and Aggarwal, 2012). The hacker is capable of identifying common password patterns and generating a new dictionary file based on common dictionary file using the standard password patterns (Tatli, 2015). These pattern-based passwords are not strong enough to avoid attacks and are prone to such attacks. Hence, it is challenging to secure weak passwords using even powerful hashing algorithms. Offline attacks have become very dangerous due to the following reasons:  Improvement in the computing hardware day by day, as stated by Moore’s law makes it cheaper to crack passwords (Moore, 2006).  Mostly users select very low entropy passwords (Doel, 2013)  Now, the attacker has enough dataset of passwords from previous breaches, so they possess very accurate knowledge about the pattern of popular passwords. Various password hash functions like PKDF2, Bcrypt, and Scrypt apply key-stretching technique to make it more difficult and expensive for offline attackers to crack hashed passwords. Keystretching reduces the number of attempts an attacker takes to break the hashed password, but it is also a trade-off for the legitimate server as it increases the authentication cost every time a user authenticates (Komanduri et al., 2014).

3. Implementation This section illustrates the working of user registration and login into any website. Fig. 1 shows that how the password is stored in the database. Firstly, the user registers on the website

Fig. 1. Storing password in the database.

Fig. 2. Comparing the hash of input password with the hash of the stored password in the database.

Please cite this article as: A. Singh and S. Raj, Securing password using dynamic password policy generator algorithm, Journal of King Saud University – Computer and Information Sciences, https://doi.org/10.1016/j.jksuci.2019.06.006

A. Singh, S. Raj / Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx

in which user has to provide various details like username, new password, security code, etc. We are focusing on password which is chosen by the user based on the password policy generated by the algorithm, which is dynamic. Password policy is a set of rules which is designed to increase security by encouraging users to create strong passwords. For example, following are the password policies for creating a strong and dynamic password:    

Minimum of 8 characters in length. Maximum of 20 characters in length. Choose from the given good characters. Avoid bad characters.

The created password is strong and complex as it follows the policy which is dynamic. The generated strong plain-text password is hashed using a hash algorithm which is a slow hash function then it is stored in the database. After successful registration to the website, when a registered user login to the website, the provided password, is hashed again using the same hash function and since the user-id is a primary key(as it is unique) in the database, using this, it searches for the stored hashed password in the database. After getting the desired hashed password in the database, it is compared with the produced hash and if both matches then the user is allowed to access the resources of the website. It is shown in Fig. 2. Since the methodology is the combination of generating the strong password by enforcing dynamic password policy and hashing with the standard Password-Based Key Derivation Function-2, it makes the proposed system more secure related to others.

3

structure used for storing key & value pairs). The function initialize alphabets initializes the frequency of all alphabets(a-z,AZ) equal to zero, and the function initialize rest initializes the frequency of special characters(!@#$%. . .etc) and digits(0–9) equal to zero. Algorithm 1 initialize characters 1: procedure initialize alphabets For alphabets 2: for i ¼ 65 to 91 do 3: p i .p is a character variable 4: m1½p 0 .m1 is a map data structure 5: fori ¼ 97 to 123do 6: p i .p is a character variable 7: m1½p 0 .m1 is a map data structure 8: procedure initialize rest For characters 9: for i ¼ 33 to 63 do 10: p i .p is a character variable 11: m2½p 0 .m2 is a map data structure

4.2. Pseudo-code for calculating threshold of the characters In the second module, the threshold is calculated for all characters. Maximum frequency is calculated among all characters, and then half of the maximum is returned if the distribution is not uniform and that makes it dynamic in nature. This function ensures that frequency of every character should be uniform and there should not be any bias on the frequency of character.

4. Algorithm for generating password policy dynamically Algorithm 2 In this section, an algorithm for generating password policy is given. There are four modules of algorithm namely initialize_characters, calculate_threshold_characters, check_uniformity_characters and good_alphabets. Table 1 describes all the parameters that are used in the proposed algorithm. 4.1. Pseudo-code for initializing frequency of all characters to zero In the first module, the frequency of all characters is initialized to zero, and it is stored in a hash-map(which is a data

Table 1 Parameters Description. Variables

Description

m1; m2; check alpha; check rest threshold alphabets

Map data structure variable that stores the threshold of alphabets variable that stores the threshold of special characters and digits variable that stores the total length of the password variable that stores the number of alphabets in the password variable that stores the number of special characters and digits variable that stores the password entered by the user

threshold rest p q pq s

1: procedure calculate threshold characters 2: For alphabets: 3: maximum 0.maximum is a integer variable 4: for it 2 fm1:begin; . . . ::; m1:endgdo 5: if it second P maximumthen 6: maximum it second 7: return maximum/2 8: For other characters: 9: maximum 0.maximum is a integer variable 10: for it 2 fm2:begin; . . . ::; m2:endgdo 11: ifit second P maximum 12: maximum it second 13: return maximum/2

4.3. Pseudo-code for checking uniformity of characters Here, uniformity of all characters is checked by comparing the frequency of all characters. If the value of the variable flag is 0 then it is uniform otherwise it is non-uniform. The function check uniformity alphabets checks the uniformity of all alphabets and the function check uniformity rest checks the uniformity of special characters and digits. This function constantly checks for the uniformity of the characters to avoid any kind of pattern in the database.

Please cite this article as: A. Singh and S. Raj, Securing password using dynamic password policy generator algorithm, Journal of King Saud University – Computer and Information Sciences, https://doi.org/10.1016/j.jksuci.2019.06.006

4

A. Singh, S. Raj / Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx

Algorithm 3 check uniformity characters 1: procedure check uniformity alphabets For alphabets 2: fl 0; f 0; tmp 3: for it 2 fm1:begin; . . . ::; m1:endg&&f 0 do 4: if fl 0 then 5: tmp it second 6: fl 1 7: else 8: if tmp – it second then 9: f 1 10: return f 11: procedurecheck uniformity rest For other characters 12: fl 0; f 0; tmp 13: for it 2 fm1:begin; . . . ::; m1:endg&&f 0 do 14: if fl 0 then 15: tmp it second 16 fl 1 17: else 18: if tmp – it second then 19: f 1 20: return f

4.4. Pseudo-code for printing good characters to be included in the password

Algorithm 4 (continued) 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33:

check alpha:erase½it it þ þ f check uniformity alphabets if f 0 then initialize alphabets 0 threshold alphabets else tmp calculate threshold alphabets tmp threshold alphabets for it 2 fm2:begin; . . . ::; m2:endg do if it second 6 threshold alphabets then printit second 1 check alpha½it first

Algorithm 2 in the paper calculates the threshold of the characters in such a way that it will never let the frequency of any character become high. It will search for the character whose frequency is highest and then return the half of that as threshold and then in algorithm 4 it will erase all the characters whose frequency is more than the calculated threshold. So this will maintain uniformity in the database and leakage is not possible. Leakage is possible if database has a specific pattern of the stored characters which is a result of static password policies and here we are avoiding static password policies making the policies dynamic. 5. Advantages of generating password policy dynamically

In the end, after checking uniformity if the value of the variable f is equal to zero then the function check uniformity alphabets is invoked to initialize the frequency of all alphabets equal to zero and initialize threshold_alphabets variable equal to zero. If the value of the variable f is equal to one then the function calculate threshold alphabets is invoked to calculate the threshold of the alphabets and then store the value of threshold into the variable threshold alphabets. Finally, the threshold of the alphabets, which is less than or equal to the threshold alphabets are considered as good characters, and it is displayed on the screen. A user will construct password by choosing characters from the good characters. Here good characters mean the characters which must be included in the password created by the user. Algorithm 4 1: proceduregood alphabets 2: For alphabets: 3: it check alpha:begin 4: while it – check alpha:end do 5: check alpha:erase½it 6: it þ þ 7: f check uniformity alphabets 8: if f 0 then 9: initialize alphabets 0 10: threshold alphabets 11: else 12: tmp calculate threshold alphabets tmp 13: threshold alphabets 14: for it 2 fm1:begin; . . . ::; m1:endg do 15: it second 6 threshold alphabets then 16: printit second 1 17: check alpha½it first 18: For other characters: 19: it check alpha:begin 20: it – check alpha:end do

Yang et al. have studied the behavior of the static password strength checker and found that existing checkers do not demonstrate effective or uniform characterization of strong passwords (Yang et al., 2017). Password strength checkers cannot demand users to create a strong password. Password strength checkers can also be attacked to study its behavior and can help attackers to make their attack effective. As policies of the static password policy generator are not dynamic, it exerts a bias on the characteristics of the password. The password stored in the database follows a specific pattern enforced by the password strength checker. However password strength checkers vary among different websites, but they rely on the similar policies that follow some specific password properties (e.g., length of the password, number of special characters, number of digits). To tackle this problem, an algorithm is developed which generates password policies dynamically to all users. When a new user wants to register on the website, then a dynamic policy is generated. No user can know what policy other user has received. Generating password policies dynamically, evenly distribute the password in the database and expand the password space. It is difficult for the attacker to analyze the characteristics of the password database. 6. Time complexity Here, Table 2 contains a summary of time complexity, i.e., the time required for generation of passwords. The time needed to Table 2 Time Complexity. Number of password generated

Time taken

10 100 1000 10000 100000 1000000

0.004000 s 0.047000 s 0.381000 s 2.592000 s 24.523000 s 209.226000 s

Please cite this article as: A. Singh and S. Raj, Securing password using dynamic password policy generator algorithm, Journal of King Saud University – Computer and Information Sciences, https://doi.org/10.1016/j.jksuci.2019.06.006

A. Singh, S. Raj / Journal of King Saud University – Computer and Information Sciences xxx (xxxx) xxx

generate password policies for 10, 100, 1000, 10000, 100000 and 1000000 users is calculated. The algorithm seems to be fast as it generated 1000000 passwords in 209.226 s. 7. Password based key derivation function-2 In this section, it is discussed, how to store the hash of the password in the database using the popular hashing algorithm PBKDF2. In PBKDF2 with 10,000 iterations, for example, user’s password and salt is fed into HMAC-SHA-256 and run the loop for one time and then the password and the previously-computed HMAC hash is fed into HMAC-SHA-256 for the remaining 9999 times around the loop. 7.1. Storing hash in the database The iteration count, the salt, and the final PBKDF2 hash are stored to the password database. After users with old-style hashes log in successfully, regenerate and update their hashes using the new iteration count. For users who haven’t logged in for some time, and whose old hashes is now considered insecure, we can disable the accounts and force the users through a password reset procedure if ever they do log in again. Finally, to store users’ passwords safely, a strong random number generator is used to create a salt of 16 bytes or longer. The salt and the password are fed into slow hashing algorithm like PBKDF2. HMAC-SHA-256 is the core hash function inside PBKDF2. To make it secure enough 40,000 iterations or more is performed (till August 2017). 32 bytes (256 bits) of output is taken from PBKDF2 as the final password hash, and then the iteration count, the salt, and the final hash are stored in the password database. Iteration count should be increased periodically to keep up with faster cracking tools. 8. Results and discussion In this paper, an algorithm has been developed that generates password policies dynamically depending on the frequency of characters. We have computed time complexity of the algorithm, and it is found that the algorithm works fast. Since the algorithm generates password policies dynamically, it will be challenging for the attacker to guess the characteristics of the password database. This algorithm also increases password space as most of the special characters like!%$# never used in password creation. Including these characters in the password will make the password more complex and more difficult for attacker to crack. The objective of this password policy generator is to secure the existing websites which are vulnerable to various attacks such as brute-force, rainbow table attack, dictionary attack, etc. Generating password dynamically make the password secure and then hashing it with the enhanced hashing algorithm (like PBKDF-2, Bcrypt, Scrypt, etc.) make the cracking of the password more difficult even if the attacker has breached the server and compromised the database. As we are using an algorithm which detects the frequency of the characters and then generate the password policy accordingly, it will be very difficult for the attacker to analyze the characteristics of the password distribution in the database. Therefore, it will be very costly for an attacker to crack those dynamically generated passwords. Thus, our dynamic password policy generator can be used to diminish the threat of offline attack. Declaration of Competing Interest

5

References Almeshekah, M.H., Gutierrez, C.N., Atallah, M.J., Spafford, E.H., 2015. Ersatzpasswords: Ending password cracking and detecting password leakage. Proceedings of the 31st Annual Computer Security Applications Conference. ACM, pp. 311–320. Blocki, J., Datta, A., 2016. Cash: a cost asymmetric secure hash algorithm for optimal password protection. Computer Security Foundations Symposium (CSF), 2016 IEEE 29th. IEEE, pp. 371–386. Bonneau, J., 2012. The science of guessing: analyzing an anonymized corpus of 70 million passwords. 2012 IEEE Symposium on Security and Privacy (SP). IEEE, pp. 538–552. Castelluccia, C., Dürmuth, M., Perito, D., 2012. Adaptive password-strength meters from markov models. NDSS. Castelluccia, C., Chaabane, A., Dürmuth, M., Perito, D., 2013. When privacy meets security: Leveraging personal information for password cracking. arXiv preprint arXiv:1304.6584.. Doel, K., 2013. Scary logins: Worst passwords of 2012 and how to fix them. SplashData, 2012.. Halderman, J.A., Waters, B., Felten, E.W., 2005. A convenient method for securely managing passwords. Proceedings of the 14th international conference on World Wide Web. ACM, pp. 471–479. Hoek, E., Marinos, P., Benissi, M., 1998. Applicability of the geological strength index (gsi) classification for very weak and sheared rock masses. the case of the athens schist formation. Bull. Eng. Geol. Environ. 57 (2), 151–160. Houshmand, S., Aggarwal, S., 2012. Building better passwords using probabilistic techniques. Proceedings of the 28th Annual Computer Security Applications Conference. ACM, pp. 109–118. Ji, S., Yang, S., Wang, T., Liu, C., Lee, W.-H., Beyah, R., 2015. Pars: a uniform and opensource password analysis and research system. Proceedings of the 31st Annual Computer Security Applications Conference. ACM, pp. 321–330. Kallapur, P.V., Geetha, V., 2011. Web security: a survey of latest trends in security attacks. In: Advances in Computer, Communication, Control and Automation. Springer, pp. 405–415. Kelley, P.G., Komanduri, S., Mazurek, M.L., Shay, R., Vidas, T., Bauer, L., Christin, N., Cranor, L.F., Lopez, J., 2012. Guess again (and again and again): Measuring password strength by simulating password-cracking algorithms. 2012 IEEE Symposium on Security and Privacy (SP). IEEE, pp. 523–537. Komanduri, S., Shay, R., Cranor, L.F., Herley, C., Schechter, S.E., 2014. Telepathwords: Preventing weak passwords by reading users’ minds. USENIX Security Symposium, pp. 591–606. McKenzie, B.J., Harries, R., Bell, T., 1990. Selecting a hashing algorithm. Software: Practice Experience 20 (2), 209–224. Moore, G.E., 2006. Progress in digital integrated electronics [technical literaiture, copyright 1975 ieee. reprinted, with permission. technical digest. international electron devices meeting, ieee, 1975, pp. 11–13.]. IEEE Solid-State Circuits Society Newsletter 20 (3). Raikar, A., Ramarao, G., 2010. Method and system for establishing a consistent password policy. US Patent 7,849,320.. Ross, B., Jackson, C., Miyake, N., Boneh, D., Mitchell, J.C., 2005. Stronger password authentication using browser extensions. In: USENIX Security Symposium, Baltimore, MD, USA, pp. 17–32. Sadeghian, A., Zamani, M., Abdullah, S.M., 2013. A taxonomy of sql injection attacks. 2013 International Conference on Informatics and Creative Multimedia (ICICM). IEEE, pp. 269–273. Shay, R., Komanduri, S., Kelley, P.G., Leon, P.G., Mazurek, M.L., Bauer, L., Christin, N., Cranor, L.F., 2010. Encountering stronger password requirements: user attitudes and behaviors. Proceedings of the Sixth Symposium on Usable Privacy and Security. ACM, p. 2. Stevens, M., Bursztein, E., Karpman, P., Albertini, A., Markov, Y., 2017. The first collision for full sha-1. Annual International Cryptology Conference. Springer, pp. 570–596. Stobert, E., Biddle, R., 2014. The password life cycle: user behaviour in managing passwords. Proc. SOUPS. Tatlı, E.I., 2015. Cracking more password hashes with patterns. IEEE Trans. Inform. Forensics Security 10 (8), 1656–1665. Vedula, S., Morris, C.C., Henderson, L.H., 2012. Techniques for real-time adaptive password policies. US Patent 8,332,918.. Vykopal, J., Plesnik, T., Minarik, P., 2009. Network-based dictionary attack detection. 2009 International Conference on Future Networks. IEEE, pp. 23–27. Wang, X., Yu, H., 2005. How to break md5 and other hash functions. Eurocrypt, vol. 3494. Springer, pp. 19–35. Weir, M., Aggarwal, S., DeMedeiros, B., Glodek, B., 2009. Password cracking using probabilistic context-free grammars. 2009 30th IEEE Symposium on Security and Privacy. IEEE, pp. 391–405. Yang, S., Ji, S., Beyah, R., 2017. Dppg: A dynamic password policy generation system. IEEE Trans. Inform. Forensics Security. Yee, K.-P., Sitaker, K., 2006. Passpet: convenient password management and phishing protection. Proceedings of the second symposium on Usable privacy and security. ACM, pp. 32–43. Zhai, S., He, T., 2010. Design and implementation of password-based identity authentication system. 2010 International Conference on Computer Application and System Modeling (ICCASM), vol. 9. IEEE, pages V9–253.

None. Please cite this article as: A. Singh and S. Raj, Securing password using dynamic password policy generator algorithm, Journal of King Saud University – Computer and Information Sciences, https://doi.org/10.1016/j.jksuci.2019.06.006