Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Swing-AWT Authentication of password

Have Programming Question? Ask it here!
 
 
 


manjiri
Authentication of password
4 Answer(s)      5 years and 9 months ago
Posted in : Swing AWT



Advertisement
View Answers

December 16, 2008 at 7:04 AM


check out the below link


December 17, 2008 at 12:39 AM




December 17, 2008 at 6:08 AM


Hi friend,



I am sending running code, please implement this code.

import java.io.*;
import javax.crypto.Cipher;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.KeyGenerator;
import java.security.Key;
import java.security.InvalidKeyException;

public class EncryptData {
private static String algo = "DESede";

private static Key genkey = null;

private static Cipher cipher = null;



private static void setUp() throws Exception {

genkey = KeyGenerator.getInstance(algo).generateKey();

cipher = Cipher.getInstance(algo);

}





public static void main(String args[]) throws Exception {

String str = "";
setUp();

if (str ==null && str=="") {

System.out.println("Please enter String.");

System.exit(1);

}

byte[] enByte = null;

String inputStr = args[0];

System.out.println("Entered: " + inputStr);

enByte = enDt(inputStr);

String str1 = enByte.toString();

String str2 = dedt(enByte).toString();

System.out.println("Input String: " + inputStr);

System.out.println("Encrypt code: " + str1);

System.out.println("Decrypt code: " + str2);
}



private static byte[] enDt(String inputStr)

throws Exception {

cipher.init(Cipher.ENCRYPT_MODE, genkey);

byte[] inputStrBytes = inputStr.getBytes();

return cipher.doFinal(inputStrBytes);

}



private static String dedt(byte[] enByte)

throws Exception{

cipher.init(Cipher.DECRYPT_MODE, genkey);

byte[] recByte = cipher.doFinal(enByte);

String recovered = new String(recByte);

return recovered;

}

}

-----------------------------------

Thanks.


December 17, 2008 at 6:40 AM


I am sending running code. If you have any problem then explain in detail.


import java.io.*;

public class PasswordField {

public static String readPassword(String prompt) {
EraserThread eraser = new EraserThread(prompt);
Thread mask = new Thread(eraser);
mask.start();

BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String password = "";

try {
password = in.readLine();
}
catch(IOException ioe) {
ioe.printStackTrace();
}
// stop masking
eraser.stopMasking();
// return the password entered by the user
return password;
}
}

-----------------------------------------

import java.io.*;

class EraserThread implements Runnable {
private boolean stop;

// The prompt displayed to the user

public EraserThread(String prompt) {
System.out.print(prompt);
}

//Begin masking display asterisks (*)

public void run () {
stop = true;
while(stop) {
System.out.print("\010*");
try {
Thread.currentThread().sleep(1);
}
catch(InterruptedException ie) {
ie.printStackTrace();
}
}
}

//Instruct the thread to stop masking

public void stopMasking() {
this.stop = false;
}
}
------------------------------------------

public class TestApp {
public static void main(String args[]) {
String pwd = PasswordField.readPassword("Enter password: ");
System.out.println("The password entered is: "+pwd);
}
}
--------------------------------------

Visit for more information.

http://www.roseindia.net/java/example/java/swing/

Thanks.


Related Tutorials/Questions & Answers:
Authentication of password - Swing AWT
Authentication of password  System level authentication of password.... How the Printed password gets converted into the asteric (*) mark... BufferedReader(new InputStreamReader(System.in)); String password
Basic authentication
Basic authentication       Basic authentication is the process through which a web server authenticates an entity with a user name and password received by the user by using
Advertisements
Password
Password  make a program which ask ask the username and password * in this format. in C language
Authentication - JavaMail
Authentication program in Java  How to write a program in Java for user authentication
Authentication in Servlets
Authentication in Servlets  What are different Authentication options available in Servlets
PHP User Authentication Login and password check Tutorial
to the database. $dbname="name"; #Password to verify its you. $dbpass="
Authentication - Struts
Authentication  Hello everybody, How to provide high level authentication in struts application
Login authentication
Login authentication  i want d code for login authentication from mysql database on the same pc using swings
Login authentication
Login authentication  i want d code for login authentication from mysql database on the same pc using swings
gmail authentication
browser window it asks for authentication how it is possible if anybody knows plz tell... request Authentication done using Session If you signout and paste URL It Ask
Sending email without authentication
Sending email without authentication  Hi sir, Am doing a project in JSP, in that i want to send mail without any authentication of password so send me code as soon as possible.   Please visit the following links
iphone nsurlrequest authentication
iphone nsurlrequest authentication   How to authenticate a form in iPhone Application
windows authentication with hibernate - Hibernate
windows authentication with hibernate  Does anyone know how to setup a datasource for SQL Server that uses Windows authentication instead of SQL Server mixed mood authentication? Is it possible with hibernate framwork? Thanks
Login Authentication using existing Active Directory.
Login Authentication using existing Active Directory.  I need jsp code for login authentication of username and password using already existing... be Such that there should be no inputs for code other than username, password and LDAP
SSL Authentication - JSP-Servlet
SSL Authentication  With the help of a sample code describe the use of SSL Authentication of java clients
http Client Authentication
authentication problem. can any one please help me to solve this problem. please... UserId="adm"; String Password="adm"; String postTitle="Pls11...().encode((UserId+":"+Password).getBytes()))); System.out.write(entry
JDbc Login Authentication
Authentication Using ComboBox.From Servlet and jsp with sessions I am new to sessions...;<td align="left">Password:</td><td><input type="password" name="password" size="20"></td></tr> <tr><td align
login authentication - Java Beginners
login authentication  i 've designed the jsp page for login. now i need to connect it with the bean and do authentication for the login for the "register" table in mysql. can anybody help me with the code immediately
Java Glossary : Authentication
Java Glossary : Authentication       Authentication is the process of ensuring to some in order... it claims to be. This types of services works on shared secrets like password
forgot password?
forgot password?  forgot password
Struts Login Authentication
Struts Login Authentication  Hi Sir, Am doing a project in a struts 1.2,i want login authentication code fro that, only authenticated user can login into application,i am using back end as Mysql.so send me code as soon
password check
password check  how to check sighup passowrd and login password
login authentication - Development process
login authentication  hi.. how to validate username and password for both admin and user using java script which is retrive from backend
login authentication - Java Beginners
qry = "select username, password from register where username='"+username+"' and password='"+password...("username"); password=rs.getString("password
user authentication code in php - PHP
user authentication code in php  Hi, Can you please send me a user authentication code in php? or just post the guidelines to authenticate a user. Thanks
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
Reset Password
Reset Password  coding for reset password
retype password
retype password  coding for retype password
recovery of password through mail
recovery of password through mail  hi i want code for login page authentication in jsp with oracle database.it should be similar to any mail login... user account should be verified and if they forgot password then security question
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
forget password
forget password  codding for forget password using spring framework
Login authentication & mysql - Java Beginners
Login authentication & mysql  Hi , Could you guide or provide sample coding for the following scenerio. I need to code authentication for user... their personal account with the username and password, must save it in database (MySQL
Forgot password
Forgot password  hi i want to develop a code for when user clicks on forgot password then the next page should be enter his mobile no then the password must be sent to his mobile no...! Thanks in advance Nag Raj
password change
password change  Hi , I am using jsf and trying to write a code to change the password of a user . Ihave to retrine userid fromdata base how to do that using session
3D PASSWORD
3D PASSWORD  HI i would like to know abt where the 3d password in india used and also few info about the 3d password pls rply some1 as soon as possible
Password validation
password and confirm password are same or not Validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
forget password
forget password  can i get coding for forgot password in jsp, need using javamail also cannot.. what should i do?? Thx
foget password
is user login ,second is new user and third is forget password in java using netbeans.so please help me to write the code for forget password button.forget password form have three field that is userid ,security question and answer of those
password - JDBC
password  as memeber of our site, recently he forget his password now he want a new password from us. so overcome with this problem i have to send his password to his any emailid to once again login with this new pasword so
password - Security
password  How can i do password encript and decript in java  Hi friend, Code to encript and decript password in java import... password= "Hello"; System.out.println("input " + password
Forget Password
Forget Password  How i get my forget password through mail?   Please visit the following links: http://www.roseindia.net/jsf/richfaces/ http://www.roseindia.net/jsf/richfaces/developing-jsp-files.shtml
secure password
secure password   Respected Sir We need to write a function which accepts a given password and returns ââ?¬Å?ACCEPTEDââ?¬Â? or ââ?¬Å?REJECTEDââ?¬Â? based on the following rules: Passwords must consist of a mixture
secure password
secure password   Respected Sir We need to write a function which accepts a given password and returns ââ?¬Å?ACCEPTEDââ?¬Â? or ââ?¬Å?REJECTEDââ?¬Â? based on the following rules: Passwords must consist of a mixture
Username password
with the validation, so that if the username and password match it will continue... that checks whether the username and password is valid or not. If the user...("Password:"); text2 = new JPasswordField(15); SUBMIT=new JButton("SUBMIT
 

 

 

DMCA.com