Is there a reason why you need to use the openssh keyfiles (specifically) for gpg messages? If you can get by with using only pgp keys, then the issue is solved.
Ok, so here's my problem...
I'm trying to learn, and I'm pretty good at reading computer programs. I can't find a good source of reading material or potential teacher, so I figured I'd have someone write me a program as a starting point, and once I got those basics in my mind, I'd have a much easier time figuring out what to ask, what to search for, and how to get answers for a point that I thought I needed to make with someone, but I'm starting to think that I was wrong in the first place.
I think I've got about 3 main issues that I'm trying to deal with, but I couldn't figure out where to ask the questions to get the right answers and searching with Google wasn't helping since I didn't even know enough to be able to ask the right questions. I've also made some assumptions that may turn out to be false.
I'll lay out what I'm struggling with here since a conversation seems to have started (even though Marketplace/Services probably isn't the "appropriate" palce for such a conversation).
I'm working on a project.
I've been told that I'm required to receive multi-megabyte sized files that have been encrypted. I will have some sort of RSA private key that I can use for decryption. The senders will all have received the RSA public key that they use for the encryption out of band ahead of time. The senders will also each have some sort of RSA private key that they will use for a signature of some sort to prove that they are the sender of the encrypted data. They will provide me with the associated RSA public key out of band ahead of time. The filename will indicate who the sender is so that I'll know which public key to use for signature verification.
Upon receiving the file I need to first verify the signature and if the signature isn't valid I can log this fact and toss the file in the trash. If the signature is valid, I need to decrypt the file.
That all sounds nice and simple so far....
Here's where it starts to get a bit tricky. Some senders want to use openssl command line for encrypting and signing the files. Some senders want to use command line GPGtools for encrypting and signing the files. Some senders want to use some sort of java library (bouncycastle?) for encrypting and signing the files. Some senders want to use some sort of node package for encrypting and signing the files. I get to specify the symmetric cipher used to encrypt the data.
The signed, encrypted files will be dropped off in an Amazon Web Services (AWS) S3 (simple storage service) bucket. The decrypted files will need to be stored in a different AWS S3 bucket. I can use any AWS service I like to handle the verification and decryption, but unless absolutely necessary it is preferred that I not need to have a persistent elastic compute cloud (EC2) instance. The current suggestion is to have the S3 trigger Lambda with node.js code to handle the signature verification and decryption. It is also preferred that the signature, session key, and encrypted data NOT be three separate files. Therefore, they all need to be transferred together in a single file.
The data that is being dropped off on S3 may also (instead) be pushed to a web API using https POST. The web API would receive the data stream (which would contain the sig, encrypted session key, and encrypted data) and write the stream to S3 (which would then bring us right back to where we were when the sender just drops it off there themselves.
I don't need all of this written for me. I can handle most of it. However, as far as I know, GPGTools is not available within Lambda. I'm not sure yet whether or not openssl is. So, if I'm going to use node.js in Lambda to verify and decrypt, and if the sender is potentially going to use GPGTools to create the file, then I need help understanding is what that data stream is likely to look like and how I should parse it.
If I push back and say that if I'm going to do this then the senders will all need to be forced to use openssl command line, then is there a standard way of packaging the sig, encrypted session key, and encrypted data together? Someone I'm working with is pushing for us to just declare our own way of storing this stuff together (base64 encode each of the 3 pieces, then concatenate them together in a specified order with a period as a delimiter (sig.payload.session_key). I "feel" like there "ought to be" a standard way of packaging those three pieces of data together, and I don't want us to be re-inventing the wheel. I've pointed out to the guy I'm working with that GPGTools already packages them all together, but neither he nor I can find a way to do it with openssl command line. He says if I can show him a node program that can verify and decrypt a GPGTools file (without needing gpg installed), that he'll consider that perhaps we shouldn't be "rolling our own" way of packaging this data together.
In case it wasn't clear from that mess of words, the 3 problems that I "think" I have are:
- How can I verify and decrypt a file with node.js in Lambda that has been created with command line GPGTools?
- Is there a standard way that the sig, encrypted data, and encrypted session key should be packaged together when created with command line openssl
- Do I need to have completely different RSA key pairs for each of the methods that the senders might use (an openssl RSA key pair, and a GPGTools RSA key pair), and is there potential that there might be additional RSA key pairs that I might need beyond those two?
I think the program that was my "Y" in the XY Problem was essentially intended to answer the first two questions. It would show me how to decrypt a GPGTools encrypted file without gpg being installed, and I thought it would demonstrate how GPGTools was packaging up the file (though now I'm not so sure).