matlab - Deterministically generating secure passwords using a publicly visible function -


i avoid storing list of passwords, instead reliably regenerate them using publicly visible matlab function. function takes secret key, not stored anywhere, set seed of random number generator.

is secure approach regenerate account passwords need them? secure mean, more vulnerable knowing secret key is?

% start blank slate clear clc  % {url, #symbols, #upper, #lower, #numbers} accounts = { ...     'www.foo.com', [3,3,3,3]; ...     'www.bar.com', [0,4,4,4]; ...     'www.box.com', [0,2,3,2]; ...     }; key = input('secret key: ', 's'); acc = input('account name (url): ', 's'); % clear display clc  % allowed characters s = { ...     '@#$%&*=+'; ...                 % symbols     'abcdefghjkmnpqrstuvwxyz'; ...  % upper     'abcdefghjkmnpqrstuvwxyz'; ...  % lower '123456789' };                  % numbers  % find matching accounts idx = strfind(accounts(:,1), acc);  % generate password each matching account j = 1:length(idx)     if isempty(idx{j})         % skip if there no matching account         continue     end      % salted random number generator seed     rng(sum([key, ': ', accounts{j,1}]), 'twister');      ns = accounts{j,2};     n = sum(ns);      % construct password     p = '';     k = 1:length(s)         v = s{k};         p = [p v(randi(length(v),1,ns(k)))];     end     p = p(randperm(n));     fprintf('password %s %s\n', accounts{j,1}, p) end  % clear variables safety clear 

for example, prototype above results in

password www.foo.com q*pzry4@8%3f password www.bar.com 8nz8nwa6c8am password www.box.com wuw3bn9 

every time run matlab code input:

secret key: mysecretkey account name (url): www 

nice program, weakest point not algorithm, way use it.

obviously not secure type/print passwords in matlab command window. log files kept , somehow scraped password. fact password visible @ time relevant weakness if use outside own home.

the secret key can remain invisible passwordentrydialog. if want use generated pass need either observe visually or put on clipboard. either may not nice in public areas.


from technical point of view possible if put on shelf few years, matlab may not able generate same random numbers anymore. if check whether works in new version before uninstall old 1 should fine.


all in make fine mechanism home use, if can remember lot of individual passwords definately safer. note there several free services available can store passwords (protected master password).


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -