Add new generation algorithm
The scrypt-genpass compatible one is now the legacy algorithm (activated with -L or --legacy).
This commit is contained in:
parent
cfb910164f
commit
914314b927
7 changed files with 178 additions and 33 deletions
|
@ -23,8 +23,7 @@
|
|||
#import "LegacyPasswordGenerator.h"
|
||||
|
||||
@implementation LegacyPasswordGenerator
|
||||
@synthesize length = _length, site = _site, passphrase = _passphrase;
|
||||
@synthesize output = _output;
|
||||
@synthesize site = _site, passphrase = _passphrase, output = _output;
|
||||
|
||||
+ (instancetype)generator
|
||||
{
|
||||
|
@ -40,6 +39,19 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)setLength: (size_t)length
|
||||
{
|
||||
if (length < 3)
|
||||
@throw [OFInvalidArgumentException exception];
|
||||
|
||||
_length = length;
|
||||
}
|
||||
|
||||
- (size_t)length
|
||||
{
|
||||
return _length;
|
||||
}
|
||||
|
||||
- (void)derivePassword
|
||||
{
|
||||
OFSHA256Hash *siteHash = [OFSHA256Hash cryptoHash];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue