IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Crypto.PasswordAlgorithmNone Class Reference

Key generation "algorithm" that generates key as an (eventually padded and truncated) copy of its original bytes. More...

+ Inheritance diagram for IG.Crypto.PasswordAlgorithmNone:
+ Collaboration diagram for IG.Crypto.PasswordAlgorithmNone:

Public Member Functions

 PasswordAlgorithmNone ()
 
 PasswordAlgorithmNone (bool publicParameters)
 
- Public Member Functions inherited from IG.Crypto.PasswordAlgorithmBase
virtual void Init (bool publicParameters=false)
 Clears all data and resets the passwords/keys/salts generation algorithm. More...
 
virtual void Reset ()
 Resets the password/key generator (Clears its parameters and sets the initialization flag IsInitialized to false). More...
 
virtual void Init (string password, byte[] salt, int numIterations)
 
virtual void Init (byte[] password, byte[] salt, int numIterations)
 
string GetPasswordString ()
 If the generator has public parameters (flag IsParametersPublic) then the password string is returned. Otherwise, an InvalidOperationException is thrown. More...
 
byte[] GetPasswordBytes ()
 If the generator has public parameters (flag IsParametersPublic) then the password in form of a byte array is returned. Otherwise, an InvalidOperationException is thrown. More...
 
string GetSaltString ()
 If the generator has public parameters (flag IsParametersPublic) then the salt string is returned. Otherwise, an InvalidOperationException is thrown. More...
 
byte[] GetSaltBytes ()
 If the generator has public parameters (flag IsParametersPublic) then the salt in form of a byte array is returned. Otherwise, an InvalidOperationException is thrown. More...
 
int GetNuIterations ()
 If the generator has public parameters (flag IsParametersPublic) then the number of iterations is returned. Otherwise, an InvalidOperationException is thrown. More...
 
byte[] GetLastGeneratedBytes ()
 If the generator has public parameters (flag IsParametersPublic) then the last generated key in form of a byte array is returned. Otherwise, an InvalidOperationException is thrown. More...
 
int GetNuGenerations ()
 Returns the number of keys (byte sequences) generated until now. More...
 
void GetBytes (int numBytes, ref byte[] outputBytes)
 Creates and stores the next generated key of the specified length. More...
 
byte[] GetBytes (int numBytes)
 Creates and returns the next generated key of the specified length by calling GetBytes(int, ref byte[]). More...
 

Protected Member Functions

override void InitializeExternalAlgorithm ()
 Initializes eventual external algorithm used as proxy object to perform operations. More...
 
override void ClearExternalAlgorithm ()
 Clears eventual external algorithm used as proxy object to perform operations. More...
 
override void GetBytesInternal (int numBytes, ref byte[] outputBytes)
 Returns the next generated key of the specified length. More...
 
- Protected Member Functions inherited from IG.Crypto.PasswordAlgorithmBase
 PasswordAlgorithmBase (bool publicParameters=false)
 

Additional Inherited Members

- Protected Attributes inherited from IG.Crypto.PasswordAlgorithmBase
int _numIterations = 0
 
int _numGenerations = 0
 
- Properties inherited from IG.Crypto.PasswordAlgorithmBase
bool IsParametersPublic [get, protected set]
 Flag that specifies whether initialization parameters of the algorithm can be queried or not. More...
 
bool IsInitialized [get, set]
 Flag that specifies whether the algorithm has been initialized. More...
 
string PasswordString [get, set]
 Password, in form of string, to be used in generation of keys, initialization vectors, etc. More...
 
byte[] PasswordBytes [get, set]
 Password, in form of byte array, to be used in generation of keys, initialization vectors, etc. More...
 
string SaltString [get, set]
 Salt, in form of byte array, to be used in generation of keys, initialization vectors, etc. More...
 
byte[] SaltBytes [get, set]
 Salt, in form of byte array, to be used in generation of keys, initialization vectors, etc. More...
 
int NumIterations [get, set]
 Number of iteration used when generating keys. More...
 
byte[] LastGeneratedBytes [get, set]
 Last value of the generated bytes. More...
 
int NumGenerations [get, set]
 Number of generated keys (byte sequences) up to now. More...
 

Detailed Description

Key generation "algorithm" that generates key as an (eventually padded and truncated) copy of its original bytes.

$A Igor jun15;

Constructor & Destructor Documentation

IG.Crypto.PasswordAlgorithmNone.PasswordAlgorithmNone ( )
inline
IG.Crypto.PasswordAlgorithmNone.PasswordAlgorithmNone ( bool  publicParameters)
inline

Member Function Documentation

override void IG.Crypto.PasswordAlgorithmNone.InitializeExternalAlgorithm ( )
inlineprotectedvirtual

Initializes eventual external algorithm used as proxy object to perform operations.

Implements IG.Crypto.PasswordAlgorithmBase.

override void IG.Crypto.PasswordAlgorithmNone.ClearExternalAlgorithm ( )
inlineprotectedvirtual

Clears eventual external algorithm used as proxy object to perform operations.

Implements IG.Crypto.PasswordAlgorithmBase.

override void IG.Crypto.PasswordAlgorithmNone.GetBytesInternal ( int  numBytes,
ref byte[]  outputBytes 
)
inlineprotectedvirtual

Returns the next generated key of the specified length.

WARNING: with this algorithm, all successively generated keys are the same and are directly correlated to the initial state of the output. Key generation initialization parameters are not taken into account.

For the current algorithm, this method simply performs eventual cyclic padding or truncation on the initial value of the outputBytes parameter, using the UtilCrypto.PadToAlgorithmBlocksizeCyclic(byte[], int, bool) method.

Parameters
numBytesRequired length of the key.
outputBytesByte array where the generated key is stored.

Implements IG.Crypto.PasswordAlgorithmBase.

References IG.Crypto.UtilCrypto.PadToAlgorithmBlocksizeCyclic().


The documentation for this class was generated from the following file: