In general, the information security is about the practice to prevent the unauthorized information about destruction, inspection, modification, disruption, disclosure, access and use. In addition, the information can be the electrical and physical.
Additionally, we have highlighted the sample source code for the information security project in the following.
public byte[] put(byte[] msg) throws
RemoteException,
UserDoesNotExistException, InvalidNonceException,
InvalidSignatureException,
WrongUserIDException{
try {
MessageManager receivedManager = new MessageManager(msg);
UUID userID =
receivedManager.getUserID();
Key clientKey = _userKeys.get(userID);
if(clientKey == null)
throw new
WrongUserIDException(userID);
receivedManager.setPublicKey(clientKey);
receivedManager.verifySignature();
this.verifyNounce(userID, receivedManager.getNonce());
byte[] domain = receivedManager.getContent("domain");
byte[] username = receivedManager.getContent("username");
byte[] password = receivedManager.getContent("password");
Timestamp physicalTs = receivedManager.getTimestamp();
Integer logicalTs = Integer.parseInt(new String(receivedManager.getContent("LogicalTimestamp")));
if(_userlogin.containsKey(userID)){
List login_list = _userlogin.get(userID);
if(!login_list.isEmpty()){
for (Login l: login_list) {
if((Arrays.equals(l.getDomain(),domain)) &&
Arrays.equals(l.getUsername(),username)){
if(logicalTs >
l.getLogicalTimestamp()) {
login_list.remove(l);
Login newLogin = new Login(username, domain, password,logicalTs, physicalTs);
logger.debug("Updated password on "+SERVER_REGISTRY_NAME + " for userid -> " + userID.toString() );
return updateLoginList(login_list,newLogin,userID,receivedManager.getNonce().toByteArray());
}else if(logicalTs == l.getLogicalTimestamp()){
if
(physicalTs.after(l.getPhysicalTimestamp())){
login_list.remove(l);
Login newLogin = new Login(username, domain, password,logicalTs, physicalTs);
logger.debug("Updated password on "+SERVER_REGISTRY_NAME + " for userid -> " + userID.toString() );
return updateLoginList(login_list,newLogin,userID,receivedManager.getNonce().toByteArray());
}
}
}
}
}
List lList = new ArrayList(login_list);
Login l = new Login(username, domain, password,logicalTs, physicalTs);
logger.debug("Added password on "+SERVER_REGISTRY_NAME+" for userid -> " + userID.toString() );
return updateLoginList(lList,l,userID,receivedManager.getNonce().toByteArray());
}
else
throw new UserDoesNotExistException(userID);
} catch (NoSuchAlgorithmException e)
{
e.printStackTrace();
} catch (SignatureException e) {
e.printStackTrace();
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (BadPaddingException e) {
e.printStackTrace();
} catch (InvalidKeyException e) {
e.printStackTrace();
} catch (NoSuchPaddingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (IllegalBlockSizeException e) {
e.printStackTrace();
} catch
(InvalidAlgorithmParameterException e) {
e.printStackTrace();
}
return null;
}
You people can ring us at any time to acquire the finest research knowledge!!!