decrypting file from eToken - encryption

I am new to cryptography, hence I want to ask about my company's requirements.
We are using eToken with RSA support.
I have developed a code that encrypt file with public key and stored it in another file.
Now I want to pass the encrypted file to eToken, and here is my issue.
How can I access the eToken from a Java applet?
Is it right that I have to pass encrypted file to eToken and it will decrypt file for me?
How can I do this?

Related

How can I Decrypt P7S Using C#

I Have Some P7M And P7S Files got from My Client.
I want o Extract Attachments from the Corresponding Files
I am able to decrypt P7M And Extracted Attachments from that eml Files using OpenSSL
but when it come to the case of P7S the decryption method is not working
Is there any one can help to the correct way of decryption format of Openssl

How to encrypt a parameter file or hide from viewing to all users in unix path in informatica?

I Have a parameter file which I am using in mapping. This file contains credentials and other sensitive information stored as follows:
$$username=myusername
$$password=mypassword
$$secret_key=xxxnnccmmmmmz
$$Client_id=ccmmmmlksjsjkl
These $$username etc. parameters are defined in the mapping level and used. Ths parameter file is stored on the unix path which can be accessed by everyone. I need to secure this information in the file, I have heard about AES Encrypt and Decrypt but not have used it . Anyone can explain how this can be achieved and encryption can be done? or can this file be read only for owner, currently it has 775 permissions.

i can't decrypt or verify messages sent using Symantecs PGP using GPG Keychain

I'm not using command line, merely two separate GUI programs that should functionally work together, but I'm unable to both verify a signed file and decrypt a file sent to me by someone else using Symantec's PGP program and I'm using "GPG Keychain." They have my public key and I have theirs. Any idea why they're not working when they should be?

Is it safe to rename file encrypted using gpg public key?

While using GPG for encryption is it safe to rename the file after it is encrypted or depending on the algorithm used for encryption the file uses the name also for verifying the contents.
You can rename the file without issues. The original filename is safely encrypted inside the file. The filename is never used for decryption in any way.

Extend file upload class to use encryption

Is there an easy/straightforward way to extend the file upload class to encrypt files that are being uploaded? Not just encrypting the filename, but rather the data in the file itself.
I'm using mcrypt for db encryption, and would prefer to use the same for file encryption.
Looking through the Upload.php library, I don't see an obvious place where the uploaded file is read which is where I assume I'd shim in the encryption.
Any help/advice would be appreciated.
edit:
What I'm thinking is that somewhere in do_upload() (I'm thinking file_temp) the file gets encrypted before being moved (not copied!) into its final destination. However, I don't see anywhere in Upload.php where the code is working with any of the files' data outside of filename, size, type, etc. Does this approach make sense?
Rather than encrypting just the upload, use HTTPS/SSL to encrypt the entire connection between the client and server.
I decided to forgo modifying the upload class. What I did was after the file was uploaded, open the file, encrypt it, and write it out again.
$f=file_get_contents(BASE_PATH.$fileFullPath) or die ('<script>window.parent.transUpdateFail(\'no gfc'.$fileFullPath.'\');</script>');
$encf=$this->encrypt->encode($f,$this->e_key) or die ('<script>window.parent.transUpdateFail(\'no encrypt\');</script>');
$nf=fopen(BASE_PATH.$fileFullPath,"r+") or die ('<script>window.parent.transUpdateFail(\'no open '.$fileFullPath.'\');</script>');
$fw=fwrite($nf,$encf) or die ('<script>window.parent.transUpdateFail(\'no fwrite\');</script>');
fclose($nf);

Resources