public-key-encryption

Public key implementation in C for Linux

橙三吉。 提交于 2019-12-04 09:10:16
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 haven't found anything. A lot of sites point to using certificates (x.509, etc) but that is way beyond what I need. I am just looking for a way to generate and public and private keys and use a relatively well known algorithm to sign and verify a file. Any pointers to a pure C implementation out there? The focus is on code that I can reuse and not

How do I verify a JSON Web Token using a Public RSA key?

邮差的信 提交于 2019-12-04 07:12:12
New question to keep this question specific and to the point. I have a JWT from Azure and now I need verify the signature in my application. The public keys from Microsoft can be found here: https://login.windows.net/common/discovery/keys How do I use these keys to verify a signature? I can tell these these are the public keys I need as the X5T header in the JWT matches those on this public key list. I am using the JWT PHP library but everything I enter as the public key seems to fail. supplied key param cannot be coerced into a public key So using the link above, that goes from there into the

Authentication with public keys and cx_Oracle using Python

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:58:26
I've Googled a bit but I haven't found any substantial results. Is it possible to use key-based authentication to connect to an Oracle server using Python? My objective is to be able to automate some reporting I'm doing with Python without having to store a username/password anywhere in the server. One possible solution is to implement Oracle Wallet. Creating an Oracle Wallet entry involves having: a tnsname resolution name established for the said instance a username and password Example: The Oracle sid I'm working with is named ORCL, the user I have to connect with is named my_user. In your

java.lang.RuntimeException: error:03000068:bignum routines:OPENSSL_internal:CALLED_WITH_EVEN_MODULUS

孤者浪人 提交于 2019-12-04 05:45:27
问题 I want to implement RSA encryption with public and private key in the android. Implementation I have done is as below. public static String enccriptData(String dataToEncrypt) { try { String publicExponentString = "AQAB"; String PUBLIC_KEY = "BgIAAACkAABSU0ExAAQAAAEAAQBJGj09Gbyl7BS/8MytvjBUUfaktW984VHHW4lSI9y2OwaeOq4qqSD6IOHU9HL/QtwZ+wELq28eAOQSnr11hifMf6zWjIsCBHOEpLNJjL3wxjl7dUBEGMJOeZj2rmcf8v7lP/rpAtO/G8wKXhAIKLIFxcChkXwQKbQbHQ/FtX2bwg==" byte[] modulusBytes = Base64.decodeBase64(PUBLIC_KEY)

Is it possible to prevent man-in-the-middle attack when using self-signed certificates?

前提是你 提交于 2019-12-04 04:56:58
I'm not sure is similar question has been asked before (I couldn't find any), but is it possible to protect Client/Server from Man-In-The-Middle attack? I'm writing a Client application to communicate with Server. Communication will be SSLv3 based. I am OK with server's self-signed certificates, but worried about someone else generating same self-signed certificate in the same server name and pretend to be it. My Client application uses OpenSSL library. [Client and Server are thrift based, if it makes any difference]. Can I avoid such attack at the same time maintaining support for self-signed

Heroku HIPAA Compliance

不打扰是莪最后的温柔 提交于 2019-12-04 02:00:40
Is it possible to run apps on Heroku that are HIPAA compliant? More specifically, I need two apps, one that stores member information and another that stores private health information of the members. I intend to encrypt sensitive data using both asymmetric and symmetric key encryption–asymmetric for the keys that link members with their sensitive data on the other app, and symmetric for specific fields in the members app, such as name, email address and phone. My main concern is that anyone at Heroku can break the asymmetric encryption, since they have access to both apps (and private keys).

DHGEX failing with 2048-bit key under Java 8, but succeeding with 1024-bit key

北城余情 提交于 2019-12-04 01:44:47
问题 I'm using JSCH 0.1.53 to connect to a remote SSH server, which uses a 1024-bit RSA key. We are able to connect successfully to the remote server when we also use a 1024-bit RSA key, but when we generated stronger 2048-bit keys we stopped being able to connect. We got an error message that reads "prime size must be multiple of 64, and can only range from 512 to 2048" and that originates from a call to DHGEX.java (Diffie-Hellman Group EXchange). We're running Java 1.8, and the error message

iPhone Public-Key Encryption SecKeyEncrypt returns error 9809 (errSSLCrypto)

☆樱花仙子☆ 提交于 2019-12-03 21:16:45
I am trying to use the iPhone's PKI libraries to encrypt a short string (12345678), but I keep getting the error -9809 (i.e. errSSLCrypto) whenever I try to use SecKeyEncrypt. The SecureTransport.h header file describes this error simply as "underlying cryptographic error", which wasn't very meaningful. My code is as follows: - (NSData *)encryptDataWithPublicKey:(NSString *)plainText { OSStatus result = -1; NSData *plainTextData = [plainText dataUsingEncoding:NSASCIIStringEncoding]; size_t plainTextLength = [plainTextData length]; SecTrustRef trustRef; SecTrustResultType trustResult;

How to convert from String to PublicKey?

大兔子大兔子 提交于 2019-12-03 18:42:15
问题 I've used the following code to convert the public and private key to a string KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(2048); KeyPair keyPair = keyPairGen.genKeyPair(); PublicKey publicKey = keyPair.getPublic(); PrivateKey privateKey = keyPair.getPrivate(); String publicK = Base64.encodeBase64String(publicKey.getEncoded()); String privateK = Base64.encodeBase64String(privateKey.getEncoded()); Now I'm trying to convert it back to public ad

How to Create SeckeyRef from exponent and modulus of Public key and use in SecKeyEncrypt method

时间秒杀一切 提交于 2019-12-03 17:57:37
问题 Anyone please help in Creating SecKeyRef from Exponent and Modulus being my Public exponent = 010001 and Public Modulus = 008903fb6d15f352ed3b45add3216f632f7139954a5631337aba7d645ed38482e3a810b4db26aab4d1df58c147230f0c75631a3dd0554b50de44e79f4fcf205c89fd3f80e0ff8d16c2e9f56ed3ab177953d54c9c30357d04e677cedd9912906ef8a046d7b0185b7f2022a8e435b0c6ecaef93f089fc3aa3f3677550b5d842046c7 and i want to use this SecKeyEncrypt as public key 回答1: solved the problem NSData *publicTag=[self PublicKeyItems];