Encryption & Decryption

Discussion in 'Java' started by Rogue Chameleon, Sep 23, 2004.

  1. Hi all

    I've been asked to look into the encryption and decryption of attachments
    sent in emails. The specific scenario is as follows:

    - a file is created
    - the file is to be encrypted
    - the file is attached to an email and sent to a recipient
    - once received, the file should be decrypted
    - the file is read

    At first glance, I think I should be reading up on the JCA (Java
    Cryptography Architecture) and use a public key encrypt and a private key to
    decrypt. Is this right?

    Are there any online implementations or tutorials that you would suggest I
    read to learn more about this?

    --
    Rogue Chameleon...
    Rogue Chameleon, Sep 23, 2004
    #1
    1. Advertising

  2. Rogue Chameleon

    Will Hartung Guest

    "Rogue Chameleon" <> wrote in message
    news:...
    > Hi all
    >
    > I've been asked to look into the encryption and decryption of attachments
    > sent in emails. The specific scenario is as follows:
    >
    > - a file is created
    > - the file is to be encrypted
    > - the file is attached to an email and sent to a recipient
    > - once received, the file should be decrypted
    > - the file is read
    >
    > At first glance, I think I should be reading up on the JCA (Java
    > Cryptography Architecture) and use a public key encrypt and a private key

    to
    > decrypt. Is this right?
    >
    > Are there any online implementations or tutorials that you would suggest I
    > read to learn more about this?


    It is a maze of new vocabulary, acronyms, abbreviations, and scattered
    documentation. The number of assorted bits and pieces that you need to
    actually assemble boggles the mind.

    Thankfully, there are some good samples at bouncycastle.org in their openpgp
    directories.

    And that's just the encryption part. JavaMail should be handy for the actual
    message part.

    I just use it, I don't claim to understand it beyond that it does what we
    need it to do and I managed to make it work.

    Good Luck!

    Regards,

    Will Hartung
    ()
    Will Hartung, Sep 23, 2004
    #2
    1. Advertising

  3. Rogue Chameleon

    Paul Lutus Guest

    Rogue Chameleon wrote:

    > Hi all
    >
    > I've been asked to look into the encryption and decryption of attachments
    > sent in emails. The specific scenario is as follows:
    >
    > - a file is created
    > - the file is to be encrypted
    > - the file is attached to an email and sent to a recipient
    > - once received, the file should be decrypted
    > - the file is read
    >
    > At first glance, I think I should be reading up on the JCA (Java
    > Cryptography Architecture) and use a public key encrypt and a private key
    > to
    > decrypt. Is this right?


    There is an important constraint for an encrypted e-mail -- the bytes must
    all be legal ASCII characters or the e-mail system will balk at accepting
    it. This is why file attachments to e-mails are seemingly so large.

    So add this to your list of requirements that the encrypted message must
    meet.

    --
    Paul Lutus
    http://www.arachnoid.com
    Paul Lutus, Sep 23, 2004
    #3
  4. Rogue Chameleon

    John Davison Guest

    Rogue Chameleon wrote:

    > At first glance, I think I should be reading up on the JCA (Java
    > Cryptography Architecture) and use a public key encrypt and a private key to
    > decrypt. Is this right?


    [I am no expert in cryptography, mind you. ;)]

    Mostly. What usually ends up happening is you use the public key to
    encrypt a secret (symmetric) key, and use that secret key to actually
    encrypt/decrypt the document. Reason being public key encryption is
    super costly, and (from what I remember) the resulting ciphertext grows
    exponentially. (If not exponentially, than say "more than you'd want it
    to").

    >
    > Are there any online implementations or tutorials that you would suggest I
    > read to learn more about this?
    >


    It's scattered all over the place. One place you might want to look for
    more current/powerful encryption in Java is here:
    http://www.cryptix.org/
    It looks like their site is down, but you can still download the libary.

    Also, don't forget to get the "Java Cryptography Extension (JCE)
    Unlimited Strength Jurisdiction Policy Files" from Sun if you plan to
    use JCA.

    - john
    John Davison, Sep 23, 2004
    #4
  5. Ok... I've managed to generate a KeyPair (public and private) and output
    them to seperate files.

    Now, how do I use the public key to encrypt my data.txt and how do I use the
    private key to decrypt the data.txt?

    --
    Rogue Chameleon...


    "Rogue Chameleon" <> wrote in message
    news:...
    > Hi all
    >
    > I've been asked to look into the encryption and decryption of attachments
    > sent in emails. The specific scenario is as follows:
    >
    > - a file is created
    > - the file is to be encrypted
    > - the file is attached to an email and sent to a recipient
    > - once received, the file should be decrypted
    > - the file is read
    >
    > At first glance, I think I should be reading up on the JCA (Java
    > Cryptography Architecture) and use a public key encrypt and a private key

    to
    > decrypt. Is this right?
    >
    > Are there any online implementations or tutorials that you would suggest I
    > read to learn more about this?
    >
    > --
    > Rogue Chameleon...
    >
    >
    >
    Rogue Chameleon, Sep 23, 2004
    #5
  6. Rogue Chameleon

    Sudsy Guest

    Rogue Chameleon wrote:
    > Ok... I've managed to generate a KeyPair (public and private) and output
    > them to seperate files.
    >
    > Now, how do I use the public key to encrypt my data.txt and how do I use the
    > private key to decrypt the data.txt?
    >


    I suggest you start here:
    <http://www-106.ibm.com/developerworks/webservices/library/x-xmlsecuritysuite/index.html>
    Sudsy, Sep 23, 2004
    #6
  7. Rogue Chameleon

    Ann Guest

    "Rogue Chameleon" <> wrote in message
    news:...
    > Hi all
    >
    > I've been asked to look into the encryption and decryption of attachments
    > sent in emails. The specific scenario is as follows:
    >
    > - a file is created
    > - the file is to be encrypted
    > - the file is attached to an email and sent to a recipient
    > - once received, the file should be decrypted
    > - the file is read
    >


    Taking this literally,
    1. up to you, can you type?
    2. use the unix command "crypt" like this
    "crypt < myfile > newfile"
    3. use any common thing like Outlook Express
    4. use the unix command "crypt" (call user and ask for the magic word)
    5. up to you, don't forget your glasses

    > At first glance, I think I should be reading up on the JCA (Java
    > Cryptography Architecture) and use a public key encrypt and a private key

    to
    > decrypt. Is this right?
    >
    > Are there any online implementations or tutorials that you would suggest I
    > read to learn more about this?
    >
    > --
    > Rogue Chameleon...
    >
    >
    >
    Ann, Sep 23, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Srinivasa Reddy K Ganji

    database connection string encryption and decryption

    Srinivasa Reddy K Ganji, Jul 18, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    693
    Gary Varga
    Jul 18, 2003
  2. Replies:
    2
    Views:
    1,606
    Sushant Bhatia
    May 3, 2005
  3. Replies:
    6
    Views:
    657
    DishanF
    Jan 12, 2005
  4. Aidan Diffey
    Replies:
    11
    Views:
    9,475
    Chris Uppal
    Oct 24, 2005
  5. drs

    encryption/decryption help

    drs, Jan 12, 2005, in forum: Python
    Replies:
    4
    Views:
    508
    Jorgen Grahn
    Jan 12, 2005
Loading...

Share This Page