Sponsored Content
Special Forums Cybersecurity apparent non randomness in a public pgp key Post 302230547 by morten44 on Friday 29th of August 2008 11:07:59 PM
Old 08-30-2008
apparent non randomness in a public pgp key

Hello here is what I've seen
inside some public pgp keys.

Code:

gAIAAAAAAAkBAAAAAAoAAAAFAAoArwFI/gkAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAGoYABgBAACATxIA0gAAAOAIAADgCAAABAABAAIABAAAAFI5OAAC



Code:
Ai8d6dNIpI41EtBXwK/Lsm92ulmAgBZFBdFWWYJ8ILp/GY6ju///////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////4hGBBAR

I think a visual inspection of a pgp public key can at least tell me
if all characters are equal. then it must be something wrong.


Here is just a single joke example of a key I constructed for pattern match searching with a perl script.


PHP Code:

-----BEGIN PGP PUBLIC KEY BLOCK-----
CommentDon't trust this key.

mQGiBDqgzyMRBAC63IHIDuA+G0pBYRlR0s9FUXlMKiw8f7RaipaqNviEzoOdgFDm
0BnUXWL0FGEkhq6+aTgvm4a9P7ftraAis7kZzokHej2tzQdbyGcMURrY41COa2iZ
/I+/qMmx4++/u24mIqg1mY1T/AfAJj922mHES0Q6CSee23zqZWz0+qvqQwCg3gfM
19ZwrPBtPVh+uxnQ+klQKEUD/3PullwjgE1e35qf0ncWHzLm8zJprQPu8yDnqXpu
HGSz6mEBZIFxSm4CZJHulFFBgwB7vKfoa/ZfJU3KXu7eyvmRk7aS9rlJcu3A0+vA
U0bXO/OmKr8YYiD88XrTd1gfrawvRAgRWu0VjIEp24yiEYRjjTr1h+XRYijuwLXE
*deleted*
gEkeYk3w5hILkh/EnYeKh4Vurdtel5vOU42SRC9Ni9znuq1/qv167Pp3XzDauDAI
3586lV6iQyl89L0VwajKReV2jOB9NyQapjjL7xeoKbfhn3MqoVAqFSHLrS8u1AJo
BvzVUHXAZgdjtNiITgQYEQIABgUCOqDrHAASCRBo4SUrfaXFOwdlR1BHAAEBvE8A
n3Z/LhDMOs15ThLnVUAEWVoCmVznAJ4l612mBTj1oOIVOx4pu7YIuLsCpA==
=
-----END PGP PUBLIC KEY BLOCK----- 
How can I find repeating nonrandom patterns in a pgp public key? Does it exist a PGP key validator?



Please?

Last edited by DukeNuke2; 08-30-2008 at 02:44 AM.. Reason: no jokes about relegion!
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SSH - Public key

When should one have to generate a public key on a Server when the public key is already created and used by other clients? Thanks, Rahul. (6 Replies)
Discussion started by: rahulrathod
6 Replies

2. Linux

RSA decrypt with public key ?

Dear All, I need to decrypt with private key most of the time and this works for RSA. At times I need to decrypt with public key (data is encrypted with private key). This does not seem to work via VB.Net. Is there support for such an activity in Java on Linux or Windows ? Please advise. ... (3 Replies)
Discussion started by: Sushma Y
3 Replies

3. UNIX for Dummies Questions & Answers

VSFTPD Public Key Help

Hi all Ive setup a VSFTPD server and im forcing SSL encryption. I have made a key and it works perfectly. I have a client who wants to connect but is using software that needs the key to be added before he can connect. Does he need me to send the key i created and that the VSFTPD.conf... (0 Replies)
Discussion started by: mokachoka
0 Replies

4. Cybersecurity

Request for SSH2 public key

Hey all, I have a request from a third party that will be setting my firm up for an account so we can sftp files to their server in a Production environment. I know where the public keys are located on our Red Hat Linux envronment. I was going to ftp the keys from the Linux environment over to my... (2 Replies)
Discussion started by: dfb500
2 Replies

5. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

6. Shell Programming and Scripting

Public key issue

I generated a public key that we are using for ssh and sftp but I noticed that I am still being asked for a password when I run my script. is there something I need to put in my script? Our linux guy said he placed keys on both servers. (2 Replies)
Discussion started by: MJCreations
2 Replies

7. AIX

PGP importing public keys method

Hi Guys, I am trying to import the public of vendor to my system. I am getting below error while importing public key. can anyone please help me with this?? laranakejt4:/u/raja/.pgp $ pgp --import secure.asc 0x1545A56A52:import key (4007:key failed signature check) secure.asc:import key... (0 Replies)
Discussion started by: Vinoth Kumar G
0 Replies

8. UNIX for Dummies Questions & Answers

PGP importing public keys method

Hi Guys, I am trying to import the public of vendor to my system. I am getting below error while importing public key. can anyone please help me with this?? laranakejt4:/u/raja/.pgp $ pgp --import secure.asc 0x1545A56A52:import key (4007:key failed signature check) secure.asc:import key... (2 Replies)
Discussion started by: Vinoth Kumar G
2 Replies

9. UNIX for Advanced & Expert Users

Private and public key encryption

Hi, we have private and public key, encrypt file using public and want to decrypt using private key. can you please advise below commands are correct or other remedy if unix have? encrypt -a arcfour -k publickey.asc -i TESTFILE.csv -o TESTFILE00.csv decrypt -a arcfour -k privatekey.asc... (2 Replies)
Discussion started by: rizwan.shaukat
2 Replies

10. Shell Programming and Scripting

SSH command PGP key

Hi All, While using ssh command and not able to decrypt the files . if run manually and it working fine . that means connect to server and running the pgp command. ssh devtesting@198.120.190.34 'cd /home/test/load; pgp --decrypt --passphrase "pstestingThe" --input *' Cloud please help... (10 Replies)
Discussion started by: bmk123
10 Replies
CURLOPT_PINNEDPUBLICKEY(3)				     curl_easy_setopt options					CURLOPT_PINNEDPUBLICKEY(3)

NAME
CURLOPT_PINNEDPUBLICKEY - set pinned public key SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PINNEDPUBLICKEY, char *pinnedpubkey); DESCRIPTION
Pass a pointer to a zero terminated string as parameter. The string can be the file name of your pinned public key. The file format expected is "PEM" or "DER". The string can also be any number of base64 encoded sha256 hashes preceded by "sha256//" and separated by ";" When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this cer- tificate and if it does not exactly match the public key provided to this option, curl will abort the connection before sending or receiv- ing any data. On mismatch, CURLE_SSL_PINNEDPUBKEYNOTMATCH is returned. The application does not have to keep the string around after setting this option. DEFAULT
NULL PROTOCOLS
All TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. EXAMPLE
CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); curl_easy_setopt(curl, CURLOPT_PINNEDPUBLICKEY, "/etc/publickey.der"); /* OR curl_easy_setopt(curl, CURLOPT_PINNEDPUBLICKEY, "sha256//YhKJKSzoTt2b5FP18fvpHo7fJYqQCjAa3HWY3tvRMwE=;sha256//t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno="); */ /* Perform the request */ curl_easy_perform(curl); } PUBLIC KEY EXTRACTION
If you do not have the server's public key file you can extract it from the server's certificate. # retrieve the server's certificate if you don't already have it # # be sure to examine the certificate to see if it is what you expected # # Windows-specific: # - Use NUL instead of /dev/null. # - OpenSSL may wait for input instead of disconnecting. Hit enter. # - If you don't have sed, then just copy the certificate into a file: # Lines from -----BEGIN CERTIFICATE----- to -----END CERTIFICATE-----. # openssl s_client -servername www.example.com -connect www.example.com:443 < /dev/null | sed -n "/-----BEGIN/,/-----END/p" > www.example.com.pem # extract public key in pem format from certificate openssl x509 -in www.example.com.pem -pubkey -noout > www.example.com.pubkey.pem # convert public key from pem to der openssl asn1parse -noout -inform pem -in www.example.com.pubkey.pem -out www.example.com.pubkey.der # sha256 hash and base64 encode der to string for use openssl dgst -sha256 -binary www.example.com.pubkey.der | openssl base64 The public key in PEM format contains a header, base64 data and a footer: -----BEGIN PUBLIC KEY----- [BASE 64 DATA] -----END PUBLIC KEY----- AVAILABILITY
PEM/DER support: 7.39.0: OpenSSL, GnuTLS and GSKit 7.43.0: NSS and wolfSSL/CyaSSL 7.47.0: mbedtls 7.49.0: PolarSSL sha256 support: 7.44.0: OpenSSL, GnuTLS, NSS and wolfSSL/CyaSSL 7.47.0: mbedtls 7.49.0: PolarSSL Other SSL backends not supported. RETURN VALUE
Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. SEE ALSO
CURLOPT_SSL_VERIFYPEER(3), CURLOPT_SSL_VERIFYHOST(3), CURLOPT_CAINFO(3), CURLOPT_CAPATH(3), libcurl 7.54.0 December 21, 2016 CURLOPT_PINNEDPUBLICKEY(3)
All times are GMT -4. The time now is 02:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy