Saturday, February 24, 2018

We were discussing identity management with Civic.
It introduced three new components: 1) a variety of smart contracts 2) an indigenous utility token and
3) new software applications.
 Blockchain works as the ledger in these cases. The smart contracts are the code executed on the blockchain.  There is a high degree of privacy for the individual whose transactions are maintained in the ledger. The transaction does not divulge any Personally Identifiable Information but an individual can easily prove ownership of the entries.
The ledger itself is decentralized and maintained by a community where no one actor can gain enough influence to submit a fraudulent transaction or alter recorded data.
Civic introduced a proprietary token which will be used as  a form of settlement between participants to an indentity related transaction. It also provides a means to reward the participants While the service provider may follow any standards such as NIST, FIPS or PIV, Civic manages the attestation and its sharing between service providers. For example:
There is a service provider A who sells a service to user. The user sends the PII for verifying identity. A calculates a hash of the PII and records its attestation on the blockchain. User visit service provider B who wants access to all or certain of the PII. The user is willing to share the requested data and A offers a price for its attestation to B which accepts the price. User B can locate and view the blockchain transaction. It would also be able to recreate the hashes for the PII and compare them to that on the blockchain. If B is satisfied, it purchases the attestation and pays the amount into escrow via Civic tokens into escrow. The civic app with the user then transmits the PII to B. To complete the transaction, the CVC from the escrow is shared between the user and A  - the original validator.
While the benefits for recording attestations on a distributed ledger are widely acknowledged to foster a new ecosystem, an identity provider may lean to centralized model for offering innovative technologies.
For example, it may require users to login merely with their signatures. Efficient image processing algorithms can then compare signatures.  The signature pad : http://szimek.github.io/signature_pad/ is one such example which could be considered to replace password entry on many mobile devices. The user may have to flip the screen to landscape orientation but the experience can be very close to the real thing. Moreover, signature pads are  small images and purely black and white, so they are near consistent and this helps with the processing. Moreover, what people draw on the signature pads is completely their call and can even handwrite passwords instead of signature. Since the data is private both at rest and transit, this cannot be divulged with anybody else and provides a layer of security on top of the known passwords.  Signature detection and segmentation is a known field of study and techniques involve shape matching. For example: http://matlab-recognition-code.com/signature-recognition-based-on-neural-networks/





Friday, February 23, 2018

We were discussing identity management with Civic.
It is based on blockchain ledger that enables users to login with their fingerprints.  The availability of a distributed ledger does away with a password database. Civic identity management introduces three new components:
1) a variety of smart contracts
2) an indigenous utility token and
3) new software applications.
 Blockchain works as the ledger in these cases. The smart contracts are the code executed on the blockchain.  The advantages of using a distributed ledger such as blockchain include the following:
There are no middlemen for transfers and therefore there is little fees and low cost. Moreover the protocol has a rewarding mechanism
The ledger is immutable and its integrity checked and agreed on an ongoing basis. 
All transactions on the ledger are visible to anyone and any transaction done anytime is recorded.
The transactions on the ledger cannot be reversed and are immune from chargebacks. These transactions are as sound as cash transactions.
There is a high degree of privacy for the individual whose transactions are maintained in the ledger. The transaction does not divulge any PII but an individual can easily prove ownership of the entries.
The ledger itself is decentralized and maintained by a community where no one actor can gain enough influence to submit a fraudulent transaction or alter recorded data.
Would blockchain be popular without the rewarding incentive ? From a design perspective, we could ignore that.
#codingexercise
Find sum of all possible combinations for N elements
void  Combine(List<int> A, ref List<int> b, int start, int level, ref List<intsums)   
{   
for (int I = start; I < A.length; I++)   
{    
     b[level] = A[i];   
     sums.Add(GetSum(b)); 
    if (I < A.length)   
           Combine(A, ref b, i+1, level+1, ref sums);   
     b[level] = 0;   
}   

 

Thursday, February 22, 2018

We were discussing identity management with Civic.
It is based on blockchain ledger that enables users to login with their fingerprints.  The availability of a distributed ledger does away with a password database. Civic identity management introduces three new components:
1) a variety of smart contracts
2) an indigenous utility token and
3) new software applications.
 Blockchain works as the ledger in these cases. The smart contracts are the code executed on the blockchain.  The advantages of using a distributed ledger such as blockchain include the following:
There are no middlemen for transfers and therefore there is little fees and low cost. Moreover the protocol has a rewarding mechanism
The ledger is immutable and its integrity checked and agreed on an ongoing basis. 
All transactions on the ledger are visible to anyone and any transaction done anytime is recorded.
The transactions on the ledger cannot be reversed and are immune from chargebacks. These transactions are as sound as cash transactions.
There is a high degree of privacy for the individual whose transactions are maintained in the ledger. The transaction does not divulge any PII but an individual can easily prove ownership of the entries.
The ledger itself is decentralized and maintained by a community where no one actor can gain enough influence to submit a fraudulent transaction or alter recorded data.
#codingexercise
we were discussing compute based methods of finding products of all length combinations from sequence 1 to N 
We could simply do this with Combine
Void  Combine(List<int> A, ref List<int> b, int start, int level, ref List<int> products)  
{  
for (int I = start; I < A.length; I++)  
{   
     b[level] = A[i];  
     products.Add(GetProduct(b));
    if (I < A.length)  
           Combine(A, ref b, i+1, level+1, ref products);  
     b[level] = 1;  
}  

Wednesday, February 21, 2018

We were discussing identity management with Civic.
It is based on blockchain ledger that enables users to login with their fingerprints.  The availability of a distributed ledger does away with a password database. Civic identity management introduces three new components:
1) a variety of smart contracts
2) an indigenous utility token and
3) new software applications.
 Civic builds a system to enable on-demand, secure and low cost access to identity verification aka IDV. Agencies that perform IDV are called validators, the individual whose identity is verified is called a user and the stamp of approval is called an attestation.  The user's information that is attested is called PII - short for personally identifiable information. This form of improvement enabled Civic to allow users to be recognized merely by their thumbprint while the digital identity was attested.
Attestations can be sold while the PII may not be sold. Civic introduced a token or CVC which is used as a form of settlement between participants for identity related transactions. CVC therefore becomes a currency whose transactions can be specified by the contracts. Civic aims to introduce new services  and improve existing services that can be exchanged for this currency. These services may include personal background checks, blockchain notary services, web monitoring and searches, individual credit reports, peer to peer identity services. The currency facilitates and audits the transactions while the services provide the means for the value paid for. In a way the notion of tokens is used to reward the use of services and are generally accumulated by the user not the service provider or requestor. Blockchain works as the ledger in these cases. The smart contracts are the code executed on the blockchain.  The advantages of using a distributed ledger such as blockchain include the following:
There are no middlemen for transfers and therefore there is little fees and low cost. Moreover the protocol has a rewarding mechanism
The ledger is immutable and its integrity checked and agreed on an ongoing basis. 
All transactions on the ledger are visible to anyone and any transaction done anytime is recorded.
The transactions on the ledger cannot be reversed and are immune from chargebacks. These transactions are as sound as cash transactions.
There is a high degree of privacy for the individual whose transactions are maintained in the ledger. The transaction does not divulge any PII but an individual can easily prove ownership of the entries.
The ledger itself is decentralized and maintained by a community where no one actor can gain enough influence to submit a fraudulent transaction or alter recorded data.
#codingexercise
we were discussing a storage based method of finding sum of products of all combinations.
To make it more compute intensive than storage we could restructure it based on the combine method earlier or as follows(pseudocode):
void CombineIntoProductsBySelectingRfromN(List<int> A, List<int>combinations, int n, int r, int depth, int index) {

  if (index == r) {

    int product = 1;

    for (int i = 0; i < r; i++)

      product = product * combinations[i];

    sum += product;

    return;

  }

   for (int i = depth; i < n; i++) {

    combinations[index] = a[i];

    CombineIntoProductsBySelectingRFromN(a, combinations, n, r, i + 1, index + 1);

    combinations[index] = 0;

  }

}

CombineIntoProductsBySelectingRFromN(a, combinations, n, r, 0, 0);

A = 1,2,3

N = 3

r = 2


Tuesday, February 20, 2018

We were discussing identity management with Civic.
It is based on blockchain ledger that enables users to login with their fingerprints.  The availability of a distributed ledger does away with a password database. Civic identity management introduces three new components:
1) a variety of smart contracts
2) an indigenous utility token and
3) new software applications.
 Civic builds a system to enable on-demand, secure and low cost access to identity verification aka IDV. Agencies that perform IDV are called validators, the individual whose identity is verified is called a user and the stamp of approval is called an attestation.  The user's information that is attested is called PII - short for personally identifiable information. This form of improvement enabled Civic to allow users to be recognized merely by their thumbprint while the digital identity was attested.
The mechanics of attestation is achieved with the help of a Merkle tree. Each node of the merkle tree represents an element of PII along with the hash and the hash of the hashes of the child nodes.  The root hash then becomes the fingerprint of the data being attested. This root hash is converted to a valid block chain address using the additive property of the Elliptic Curve Cryptography:

  k-priv + h = k-attest

This allows the privacy for both the user and the validator to be protected because it is not easy to determine the user and validator from the above address. 
It is called an Elliptic curve cryptography because the domain parameters are bounded by an elliptical curve


#Find the sum of products of all combinations of N numbers  
Double GetSumOfProductsOfCombinations(List<double>  numbers) 
{ 
List<List<double>> combinations = GetCombinations(numbers); 
var products = combinations.Select( x => GetProduct(x)); 
return products.Sum(); 
} 
In the above method, the numbers are enumerated again and again in each of the combinations leading us to store these numbers rather than the more useful products which number one each for as many combinations as there are to consider. 
For example 1,2,3,4 
Has  
1 
1,2;   2 
1,2,3;    1,3;     2,3;     3 
1,2,3,4;   1,3,4;    2,3,4;    3,4;    1,2,4;    2,4;    4; 
We can organize the above in N-ary tree of products where the elements at each level include only those combinations whose number matches the depth. Since existing products are untouched and the new products are formed by cloning the product stored in each existing node and multiplying with the new element, products from all the combinations are considered. The data structure does not necessarily have to be a tree since we clone the existing products before multiplying with the new number and therefore we can use a list and a recursion upto the inclusion of all given elements in a combination. 
void GetProducts (int depth, list <double> elements,  ref List <double> products)
{
if  (depth == elements.count ()) return;
var newproducts = products.select (x => x * elements [depth]).ToList();
products. addrange (newproducts);
products.add (elements [depth]);
GetProducts(depth + 1, elements, ref products);
}

Monday, February 19, 2018

Fingerprint readers are returning:
We were discussing identity management without login screens.
We elaborated on the following three components as necessary for the alternatives:
1) user knowledge based component
2) server issued dynamic component
3) convenience factor
Biometrics becomes an important convenience factor for identity management when the technology to read them does not remain as restricted as they have been.
For example, Civic identity management which is based on blockchain ledger enables users to login with their fingerprints. There are a few technological advancements that's fueling this trend to return.
First, the erstwhile fingerprint reader devices are no longer space constrained. Today these readers can be part of the visual display of the screen and yet remain unintrusive for the most part. The world's first phone with a fingerprint scanner built into the display is now out. By embedding the fingerprint sensors into the displays, they are now more robust than they were with the earlier readers. Fingerprints have long been associated with the highest form of convenience but they were not fully utilized due to the limitations of the readers. They improved convenience by reducing the login experience to one-touch.
Second, the availability of a distributed ledger does away with a password database, This form of improvement enabled Civic to allow users to be recognized merely by their thumbprint while the digital identity was attested.
The mechanics of attestation is now achieved with a Merkle tree where the root hash is converted to a valid block chain address using the additive property of the Elliptic Curve Cryptography:
  k-priv + h = kattest
This allows the privacy for both the user and the validator to be protected.
#Merkel tree
every leaf node has hash of associated data block
every non leaf node has hash of labels of leaf nodes

Sunday, February 18, 2018

We were discussing identity management without login screens.
We elaborated on the following three components as necessary for the alternatives:
1) user knowledge based component
2) server issued dynamic component
3) convenience factor
The last component above is the determining factor in why dynamic challenge questions cannot be a single and complete replacement to logins and passwords. The questions can be generated dynamically by the server such as from a list of ten questions that only the user can answer and the questions do not even need to have static answers, yet they cannot be as simple as the username and password. Moreover, people like to use their email or phone numbers for their username, something that does not seem likely to change although it adds to vulnerability by tying a centralized option for resetting all accounts.
We now consider blockchain technologies for identity management as per IBM. We discussed earlier that we can persist a token/passcode/password/private-keys/HTTP-Links for the user to login in a blockchain like database, we will have no need to maintain or manage these ourselves. Alternatively, we could consider using encryption-decryption-based and server issued-and-verified claims but without requiring a centralized server.
The benefits of identity with blockchain for consumers include:
 - convenience for accessing services and resources
 - better protection of privacy
 - greater control of personal data
The benefits for businesses include:
 - reduced risk and cost of data breach
 - efficient compliance management and governance
 - easier onboarding of customers
The benefits for regulators include:
- standardized processes
- prompt auditing
- compliance control
Find the largest rectangular sub-matrix having sum divisible by k.
The naive approach is to exhaust all the rectangular sub matrices to find the sums. check that the sums are divisible by k and then update the max of the rectangular size found so far.
This appears something like
int GetLargest(int[,] M, int R, int C, int k)
{
int max = 0;
// Every element forms the top left corner of a rectangular area of different sizes
for (int i = 0; i < R; i++)
  for (int j = 0; j < C; j++)
{
   int kx = i;
   int ky = j;


    for (int m = kx; m < R; m++)
         for (int n = ky; n < C; n++)
    {
           int sum = GetSum(M, i,j,m,n);
           if (sum % k == 0)
           {
                    int size = GetSize(i,j,m,n);
                    if (size > max)
                        max = size;
           }
    }
return max;
}