Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 16 of 16

Thread: Cryptography application

  1. #1
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cryptography application

    Hello guys, I need to code a basic application for my cryptography class using JCE.
    The problem is that I am not that familiar with java and I am quite lost and don't know how to start.

    Basically I need to create a password keeping tool such as keepass.

    How can I use JCE classes to build an application that encrypts a file containing passwords please?

    If someone could explain to me simply how I can do that and how I can start that project, it would be really nice.

    I am not asking yoy to do it for me, just to help me and show me how I can start it ( for example which classes to have etc..)

    Thanks a lot


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Cryptography application

    You've chosen a fairly complex application on which to test your wings. The encryption part isn't all that hard. You can find tutorials online that'll help you work through simple encrypt/decrypt exercises. But the application you'll need to build around that for the password keeping functionality will be a challenge for someone "not that familiar with Java." You can try starting with the Java Swing Tutorials to improve your Java skills, but I don't know how much time you have. We can't teach you what you need to know. That's not what we do here.

    Good luck.

  3. #3
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    Hi thanks for your answer.

    what do you mean by "But the application you'll need to build around that for the password keeping functionality will be a challenge for someone "not that familiar with Java." ?

    I mean I ve already done java and I can build an application in netbeans using the drag and drop function, I have done some simple ones before. But I have no idea how to do the encryption part especially HOW to use JCE classes in order to encrypt a file with passwords.

    This is an assignement due for next monday and what I need is just someone who can help me by telling me how to start such as the classes that I need to have etc..

    For example, I assume in my application, I need to have an option ( button maybe) to add a new account (login/ password/ url and some notes) and then a JList maybe where will appear all the accounts I have created. But the thing is that , as in Keepass software, the password should appear crypted of course and all passwords should be encrypted in a text file ( and I don't how to do this "file" part).

    I hope someone clarify me on how to start.

    thanks

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    Try this approach. Assuming that the whole file holding the data will be encrypted instead of just the passwords.
    Put off the encrypting of the file until later. For the first version of the program write the GUI and logic and Write and read the file as text. Later the file I/O can be changed to use encrypt/decrypt code.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    The professor told me that I need to have a file containing the crypted passwords. So that when we open it, we don't understand anything. But in the application, when I want to have see them my passwords, I will be asked to enter the passphare and I can see them decrypted. A simple encryption/decryption.

    What do you advice me to do for the gui?
    And which classes should I start with?

    Here is a screen of the project so that you can understand it:

    Visionneuse images - Noelshack

    How can I have as in the screen for keepass a list of all accounts added (title, username, pass, etc..)



    Thanks again

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    Do you know how to use Swing components to build a GUI?
    I'd start with designing how the program would work:
    Does it need a password to read and display the file?
    When and how will the program get that password?
    Once the password is obtained, what will the program do?
    What is the format of the records that are written to the file?
    etc
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    I think it can be easier in netbeans as I can use the drag and drop function provided. Should I just create one new class call it let's say "gui" for the moment?

    When I used to code a little bit in java, I had some programs dealing with books manager for example and I had to create classes such: book, Member, profile, review, statistics, etc..

    What should it be in this case?

    I know that my main problem is that I forgot almost everything in java and that this is vague for me, that's why I might be asking weird questions, because I am just trying to remember what I used to do before

    Did you see the screen of the assignement? How much time do you think it needs to be done?

    thanks

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    Sorry, I do not go to other sites. Can you paste it here?

    Have you worked on the details of what the program is supposed to do?
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    Managing user names and passwords for email, network, accounts etc. can be a real hassle. A secure password solution consists in listing ones credentials (in the form of tuples <Title>,<Username>, <password>
    <URL>,<Notes>) in a text file, then encrypting the entire file with a strong encryption algorithm requiring a pass phrase. To retrieve/update ones credentials, one has to have both the encrypted textfile (.kdb) and the secure password application at hand. In this project you are required to implement a GUI based secure
    password solution, using Java Cryptographic Extension (JCE), and Java GUI packages. Users need to key in
    the passphrase to be able to retrieve, modify and delete tuples. Every care should be given to the proper use of the transformation of the passphrase to a security key.
    Beyond security, the application is expected to be functional, easy to use, and practical.

    Hints: You can take inspiration from keePass software

    As always, in order to encourage good coding practices in projects that include programming, I will grade your work on quality from both the user's and programmer's points of view. Each program should contain function-level and local comments as appropriate, as well as an explanation of the program's principles of operation.

    Plus there is a screen shot of Keepass software.

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    Have you worked on the details of what the program is supposed to do?
    Have you looked at the questions in post#6?

    Is it possible to write the first version of the program without encrypting and decrypting the data file?
    Then later changing the program to do the encrypting.
    If you don't understand my answer, don't ignore it, ask a question.

  11. #11
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    "Is it possible to write the first version of the program without encrypting and decrypting the data file?" Are you asking me or is it an affirmation?

    I have been thinking about that but I have clearly NO IDEA on how I can implement the password request option. This part "Users need to key in
    the passphrase to be able to retrieve, modify and delete tuples. Every care should be given to the proper use of the transformation of the passphrase to a security key." seriosuly I have no idea how to do it.

    Yes i've looked at the questions in post 6.

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    Every care should be given to the proper use of the transformation of the passphrase to a security key
    Sorry, I have no idea what that means.
    If you don't understand my answer, don't ignore it, ask a question.

  13. #13
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    "Is it possible to write the first version of the program without encrypting and decrypting the data file?" Are you asking me or is it an affirmation?

    Also I would like to ask you, how can I for example, when I click on a button to add a new account, then enter all necessary info, have every account added to a list (there should morre than a list no?) and also written to a file ( I will not care about encryption for now). And how can I implement the password function?

    thanks

  14. #14
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Cryptography application

    how can I for example, when I click on a button to add a new account, then enter all necessary info
    Have the button listener show a custom dialog with the necessary fields to collect all the necessary info.

    how can I implement the password function?
    What is the password function supposed to do? You need to define its functions before it can be implemented.
    If you don't understand my answer, don't ignore it, ask a question.

  15. #15
    Member
    Join Date
    Oct 2012
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    Ok I will think it about it more and then let you know after. thanks

  16. #16
    Junior Member
    Join Date
    Jan 2014
    Location
    SPAIN
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Cryptography application

    i think than more that speaking ,will be nice a source code! ¬¬

Similar Threads

  1. java code related to unicode in cryptography
    By salinii in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 28th, 2014, 09:45 AM
  2. Replies: 1
    Last Post: August 23rd, 2013, 06:33 AM
  3. how to run any installed application through my java application??
    By sgsamanthjain in forum Java Theory & Questions
    Replies: 1
    Last Post: April 1st, 2011, 08:17 AM
  4. Replies: 2
    Last Post: March 23rd, 2011, 08:51 AM
  5. Replies: 0
    Last Post: December 3rd, 2009, 04:43 PM