Create strong passwords

버전 1.0.0.0 (6.55 KB) 작성자: Alan Jennings
Creates passwords with customizable character limits also allowing for limited character sets
다운로드 수: 644
업데이트 날짜: 2014/7/21

라이선스 보기

This function creates passwords with the maximum entropy as allowed by constraints set by the user. Constraints can be set to specify the length of the password, or minimum numbers of character sets. All unspecified characters can come from any possible symbol. Using ‘rng shuffle’ in the code, shuffles the random number generator so that passwords cannot be recreated based on pseudorandom number generator seed.
I created this after having to create an excessive number of long, strong passwords, not correlated with previous passwords. Care was taken to make the process as random as possible for the highest strength protection. Other files didn’t have sufficient freedom, or were less rigorous.
---
Password=CreatePassword(N,N_c,N_C,N_n,N_s,List_s) %individual inputs
Password=CreatePassword([N,N_c,N_C,N_n,N_s]) % single vector of quotas
Password=CreatePassword(N,[N_c,N_C,N_n,N_s]) %length and quota vector
All inputs are optional. Vector length can be from 2 to the upper limit.
---
N : Exact number of characters in password. Increased as needed based on quotas. Default value of 8
N_c : Minimum number of lowercase characters. If negative, no lowercase characters are used. Default value 0, meaning no lowercase characters required, but are allowed.
N_C : Minimum number of uppercase characters. If negative, no uppercase characters are used. Default value 0.
N_n : Minimum number of number characters. If negative, no number characters are used. Default value 0.
N_s : Minimum number of symbol characters. If negative, no symbol characters are used. Default value 0.
List_s: User specified list of characters. Primarily meant to specified allowed symbols, but can be used for any required set. Can be specified as ASCII character code (float), or as a character string ('!@#$%'). Default value are all the printable ASCII symbols (ie, non-whitespace).
---
% % % Example (shown in published results) % % % %
%% Default Behavior:
CreatePassword % Default is 8 character password of all ASCII values
ans = w69nGj/1
%% 5 characters, only lowercase letters and numbers
CreatePassword(5,0,-1,0,-1) %5 character password of only lowercase and numbers
ans = v1onw
%% Using single vector
CreatePassword([5,2,2,4])
ans = 915YkG5d
% 5 (8 actually) character password with at least 2 lowercase, 2 uppercase and 4 numbers (no symbols due to no unalocated spaces)
%% Using Length and vector
CreatePassword(5,[2,2,4])
ans = 7hFD59j9
% 5 (8 actually) character password with at least 2 lowercase, 2 uppercase and 4 numbers (no symbols due to no unalocated spaces)
%% Negative requirements mean characters will not be used
CreatePassword(8,[-1,-1,4])
ans = ]24:25[]
% 8 character password with at least 4 numbers and no lowercase or uppercase
CreatePassword(8,[-1,-1,4,-1])
ans = 71983209
%8 number password with no symbols
%% User specified set, not checked for uniqueness
CreatePassword(18,-1,-1,-1,0,'6669')
ans = 696666996696666669
% password using only the characters 6 and 9, (6 is three times more likely, so roughly 4 9's are expected, on average)
---
Known issues:
Random number generator state is shuffled which may affect other programs that rely on pseudorandom behavior for validating results.
Passwords are hard to break, but they are also hard to remember. Passwords should always be kept in lists at least 3x’s the number of unauthorized attempts long.
Length of password cannot be set to be random.
---
Cheers, Alan Jennings

인용 양식

Alan Jennings (2024). Create strong passwords (https://www.mathworks.com/matlabcentral/fileexchange/47303-create-strong-passwords), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0