Is KeyFactory compatible with threads?

There is a service class that needs to generate PublicKey instances from X.509-encoded public key representations. One instance of this class will service multiple threads. Is it correct to do something like this? public class MyService { private fin

getByte () returns the same byte [] for different strings

I am generating a Session key, that changes every time i run the program. But when i am converting it into BYTE ARRAY then Byte Array generated is same every time i run the program . IT should be different right? Here is my code Key key; SecureRandom

Android decryption error

I am trying to encrypt and decrypt Strings in my Android application but I keep getting an InvalidKeyException error. Here is my code: //Generate Keys method public void generateKeys() { Calendar cal = Calendar.getInstance(); Date now = cal.getTime()

How to perform ECKA and have an ECPoint returned?

I'm using Bouncy Castle to perform the Elliptic Curve Key Aggreement using the ECDH protocol in a smart card related software, as defined in the BSI-TR-03111 specs, ยง3.4 with The purpose is to perform the Generic Mapping of the nonce in the PACE prot

Can I implement TLS by ignoring certain steps?

Is it possible to have a cut down implementation of TLS , where we just presume the server we are connecting to is trusted - after the server sends its certificate, can we bypass verification of this and do away with any further processing , and get

Java to RSA Objective-C implementation

I'm in trouble in implementing RSA encryption and decryption in Objective-C, I made it in Java very simply and now I tried to translate this java code in objc. Here is my java code: public static byte[] encryptRSA(byte[] text, PublicKey key) throws E

Create keys without writing them to disk?

Preamble I was digging deep into the .Net x509certificate2 and x509certificate objects noticed that both the certificate classes serialize the private key to disk by default due to the verifiable use of Persist-Key options in the constructors of the

How to encrypt a number greater than N on RSA?

Here is an example: p = 11, q = 5, N = p*q = 55, choose encryption exponent e = 3, so d = e^-1 mod (p-1)(q-1) = 27. If I want encrypt x=13, x^e=13^3=52mod55. I understand how to encrypt a number which is less than N, but how to encrypt a number which

to determine if the bits are encrypted?

let's assume that I am listening a network , and I acquired some bits, but I want to know if there is a way to determine bits are encrypted ? what method or algorithm exists ? I mean if the bits are meaningless, it means encrypted but is there are mo

what is different between public keys

I have tried to create a public key in two ways, I created Self Signed Certificate and export it to .pfx file and used Openssl to get temp.cer file which contains the public key used openssl to generate a public key as follows. openssl genrsa -out my

Check the digital signature with the public key in iOS

How to Verify digital signature with public key in iOS without using any third party code(e.g.) open SSL? I need to verify Digital signature in iOS App with a public key. Can some one help me how to achieve that without using third party software. I

Encryption and decryption involving 3 parties

I wonder if the following is possible using RSA or public key encryption algorithms in general. Say that we have 3 parties, Alice, Bob and Caesar. They all have a private-public key pair. Now, Alice has two pieces of information, encrypted by Alice's

Does mysql have asymmetric encryption capabilities?

My Question is simple - is there a build in functionality, like AES_ENCRYPT / AES_DECRYPT, for asymmetric (public / private key) encryption in MySQL? Sadly, I only find answers that involve PHP (to encrypt it in php), and stuff like that. I would lik

Source of PEM files for access to the Web service

I should have paid more attention to my classes that covered security. I'm quite confused about something. To start, here's the background of what I'm trying to accomplish. I have a web service that I need to access. The web service is set up as HTTP

Git, wanderer (lucid 32), mountain lion, permission denied

I'm having a similar problem to this: Permission denied (publickey). fatal: The remote end hung up unexpectedly while pushing back to git repository But I suspect it might be more complicated because I am running vagrant on a mac (mountain lion) and

Encryption algorithm: the user decrypts only

What encryption algorithm can use 2 keys: admin - encrypt & decrypt and user - only decrypt ?You can do this with RSA by using the private key for encryption (as if you would be signing). The tuple (d,n) would be the admin key (normally named private

Public key implementation in C for Linux

I'm trying to use public key crypto to sign and later verify a file. The file is a simple plaintext file that contains user information for authoring purposes. I tried different sites for a C implementation of a public key crypto algorithm but I have

Security tokens with unreadable private keys?

I'd like to uniquely identify users by issuing security tokens to them. In order to guarantee non-repudiation I'd like to ensure that no one has access to the user's private key, not even the person who issues the tokens. What's the cheapest/most-sec

RSA encryption in C #: Which part defines the public key?

I've generated a new public/private key pair and exported it as an XML string: RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(2048); string publicPrivateKey = RSA.ToXmlString(true); The XML string in publicPrivateKey looks like this (str

How does public key encryption work?

How does public key encryption work, using a private and public/public key to decrypt/encrypt? What does it mean for the key to be 256 bits? How is it decrypted? Is there a language for writing encryption programs or is any language fine?In brief: th

Public key cryptography with passwords chosen by the user?

The whole point is designing a simple system where users are able to send encrypted messages between them (with support from a server). In this scenario, clients have no local storage, so I'm forced to use passwords that users will be able to choose,

network connection using public key cryptography

When A sends data to B over a network connection using public key cryptography, how does A achieve the goals of authentication, confidentiality ?In a case like this, A is using B's public key, and B is using A's. Confidentiality: If A encrypts someth

Cracking short RSA keys

Given the following RSA keys, how does one go about determining what the values of p and q are? Public Key: (10142789312725007, 5) Private Key: (10142789312725007, 8114231289041741) Your teacher gave you: Public Key: (10142789312725007, 5) which mean

Encryption product keys: Public and private key encryption

I need to generate and validate product keys and have been thinking about using a public/private key system. I generate our product keys based on a client name (which could be a variable length string) a 6 digit serial number. It would be good if the