Answer:
C code explained below
Explanation:
#include <stdio.h>
#include <stdbool.h>
int main(void) {
int userNum;
bool isPositive;
bool isEven;
scanf("%d", &userNum);
isPositive = (userNum > 0);
isEven = ((userNum % 2) == 0);
if(isPositive && isEven){
printf("Positive even number");
}
else if(isPositive && !isEven){
printf("Positive number");
}
else{
printf("Not a positive number");
}
printf("\n");
return 0;
}
Answer:
SSL has operate in Application Layer to encrypt the information from user and pass it to the TCP. To enhance TCP security developer can integrate the code of SSL with application layer.
Explanation:
SSL certificate is used to enhance the security of user data and encrypt the information of passwords, data transfer and other information to make it secure. This certificate is installed at application layer to make all the information secure and send it to the Transmission Control Protocol (TCP) to send it further. The TCP can be enhanced more by adding SSL code to the application Layer of the Network.
Answer:
Kasiski’s method for determining 't' works for Vigenère cipher as well. The only difference is therefore in the second stage of the attack. In the second stage, one needs to build a frequency table for each of the 't' keys, and carry out an attack like on the mono-alphabetic cipher. Given a long enough plaintext, this will work successfully.
Explanation:
Kasiski method is a method of attacking polyalphabetic substitution ciphers such as Vigenère cipher. It is also called Kasiski test or Kasiski examination.
The method involve finding the length of the keyword and then dividing the message into that many simple substitution cryptograms. Frequency analysis could then be used to solve the resulting simple substitution.
Answer:
import java.util.Scanner;
public class HelloIDE
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = input.nextLine();
name = name.trim();
if(name.equals(""))
name = "stranger";
System.out.println("Hello, " + name + "!");
}
}
Explanation:
import the Scanner class to be able to get input from the user
Create an object of the Scanner class called input
Ask the user to enter the name and set it to the name
Trim the name using trim() method, removes the whitespaces from the string
Check the name. If name is equal to "", set the name as stranger. This way if the name is empty, or just contains whitespaces or if name is not given, name will be set as stranger.
Print the name in required format