Abstract by anuja a sonalker on Asymmetric Key Distribution


Part of the algorithm follows


Download 217.42 Kb.
Pdf ko'rish
bet22/43
Sana19.04.2023
Hajmi217.42 Kb.
#1365410
1   ...   18   19   20   21   22   23   24   25   ...   43
Bog'liq
etd


Part of the algorithm follows: 
//Compute the number of sets required
reduced_kCt =( kCt/(k-t+1) ) 
//Begin generating the split-modulus Z for key share generation. 
OrigKey = key; 
for(SetCount=1; SetCount<=reduced_kCt; SetCount++)

Z = GetZ(); //Gets a random Z < private key d. 
//Calculation of the shares: 
int 
index 
=0; 
while(index 

priv_share = key mod Z
if(priv_share > 0) 

d[index] = priv_share; 
key = key - (key mod Z); 
Z = GetZ();

index++; 

//For 
last 
share: 
d[index]= 
key; 
for(int count=0; count<=t; count++) 

SumShares = SumShares + d[count]; 

//Checking validity of generated shares: 
if (SumShares == OrigKey){ 
print(" Share generation correct ! "); 

else { 
print("Incorrect share generation !! Need to redo !! "); 


28 
}
//Put all shares in a 2D array of shares per set and writing 
to a file. (not shown)

//Function to get a non repeated value of Z 
GetZ() 

//getting a non zero random number Z lesser than key. 
Z = new BigInteger(key, 10, new Random()); //BigInteger
way of generating random Z of the size of key.
redoFlag=0; 
for(int i =0; i<=tempIndexCount; i++) 

if( ( Z == KeysMod[i]) || ( Z == key - keysMod[i] ) )

redoFlag=1; 
break; 

}
if 
(redoFlag 
==0) 

//Z was correctly generated, store Z 
KeysMod[tempIndex] 
=Z; 
tempIndexCount= tempIndex;
tempIndex++; 

else if (redoFlag ==1) 

// Need to regenerate Z: 


GetZ(); 

return Z; 

Consider a simplified example, where the complete private key is 1000. We compute the 
first set to show how the shares would be computed for a threshold of 5. 

Download 217.42 Kb.

Do'stlaringiz bilan baham:
1   ...   18   19   20   21   22   23   24   25   ...   43




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling