Found 34483 Articles for Programming

Program to extract frames using OpenCV in Python?

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:25

270 Views

OpenCV(Open source computer vision) is an open source programming library basically developed for machine learning and computer vision. It provides common infrastructure to work on computer vision applications and to fasten the use of machine learning in commercial products.With more than 2.5 thousand optimized algorithms for both computer vision and machine learning are both classic and state-of-the-art algorithms. With so many algorithms, makes it to use the library for multiple purposes including face detection & reorganization, identify objects, classify human actions in videos, track camera movements, join images together to produce a high resolution image of an entire scene and ... Read More

KeyPairGenerator getProvider() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

55 Views

The provider of the key pair object can be obtained using the getProvider() method in the class java.security.KeyPairGenerator. This method requires no parameters and it returns the provider of the key pair object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");          Provider p = kpGenerator.getProvider();          System.out.println("The Provider is: " + p.getName());       } catch (NoSuchAlgorithmException e) { ... Read More

KeyPairGenerator getInstance() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

140 Views

A KeyPairGenerator object with the key pairs for a particular algorithm can be obtained using the getInstance() method in the class java.security.KeyPairGenerator. This method requires a single parameter i.e. the algorithm name and it returns the KeyPairGenerator object created.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("RSA");          String algorithm = kpGenerator.getAlgorithm();          System.out.println("The Algorithm is: " + algorithm);       } catch (NoSuchAlgorithmException ... Read More

KeyPairGenerator generateKeyPair() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

118 Views

A key pair can be generated using the generateKeyPair() method in the class java.security.KeyPairGenerator. This method requires no parameters and it returns the key pair that is generated. Every time the generateKeyPair() method is called, it generates a new key pair.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) throws Exception {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("RSA");          KeyPair keyPair = kpGenerator.generateKeyPair();          System.out.println(keyPair);       } catch (NoSuchAlgorithmException e) ... Read More

KeyPairGenerator genKeyPair() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

100 Views

A key pair can be generated using the genKeyPair() method in the class java.security.KeyPairGenerator. This method requires no parameters and it returns the key pair that is generated.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) throws Exception {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("RSA");          KeyPair keyPair = kpGenerator.genKeyPair();          System.out.println(keyPair);       } catch (NoSuchAlgorithmException e) { System.out.println("Error!!! NoSuchAlgorithmException"); ... Read More

SecureRandom nextBytes() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

308 Views

The number of random bytes as specified by the user can be obtained using the nextBytes() method in the class java.security.SecureRandom. This method requires a single parameter i.e. a random byte array and it returns the random bytes as specified by the user.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          String s = "Apple";          byte[] arrB = s.getBytes();         ... Read More

SecureRandom getSeed() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

90 Views

The seed bytes as required can be obtained using the method getSeed() in the class java.security.SecureRandom. This method requires a single parameter i.e. the number of seed bytes that need to be generated and it returns the seed bytes as required.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          byte[] arrB = sRandom.getSeed(5);          System.out.println("The Seed Bytes in array are: " + Arrays.toString(arrB));   ... Read More

SecureRandom setSeed() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

366 Views

The random object can be reseeded using the setSeed() method in the class java.security.SecureRandom. This method requires a single parameter i.e. the required seed byte array and it returns the reseeded random object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          String str = "Apple";          byte[] arrB = str.getBytes();          sRandom.setSeed(arrB);          byte[] arrSeed = sRandom.getSeed(5);   ... Read More

SecureRandom getProvider() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

62 Views

The provider for the SecureRandom object can be obtained using the method getProvider() in the class java.security.SecureRandom. This method requires no parameters and it returns the provider for the SecureRandom object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          Provider provider = sRandom.getProvider();          System.out.println("The Provider is: " + provider.getName());       } catch (NoSuchAlgorithmException e) { ... Read More

SecureRandom getAlgorithm() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

99 Views

The name of the algorithm for the SecureRandom object can be obtained using the method getAlgorithm() in the class java.security.SecureRandom. This method requires no parameters and it returns the name of the algorithm for the SecureRandom object.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          String algorithmName = sRandom.getAlgorithm();          System.out.println("The Algorithm is: " + algorithmName);       } catch (NoSuchAlgorithmException e) { ... Read More

Advertisements