password

Ads
 

password

View Answers

October 4, 2008 at 6:35 PM

Hi friend,


Code to encript and decript password in java

import java.io.*;
import java.security.*;
import sun.misc.*;

class EncodeDecodeExample {

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

String password= "Hello";

System.out.println("input " + password);

System.out.println();

byte[] dataBuffer = password.getBytes();


//Encode as base64 and display
String encoded = encodeBase64(dataBuffer);


System.out.println("encoded " + encoded);

//Decode and display
String decoded = decodeBase64(encoded);
System.out.println("decoded " + decoded);

}//end main


//-------------------------------------------//


public static String encodeBase64(byte[] data){
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
return encoder.encodeBuffer(data);
}




public static String decodeBase64(String encoded){
String decoded = "";
try{
sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
decoded = new String(decoder.decodeBuffer(encoded));
}catch(Exception e){e.printStackTrace();};
return decoded;
}

}


Thanks

Ads









Related Tutorials/Questions & Answers:
Password
Password  make a program which ask ask the username and password * in this format. in C language
forgot password?
forgot password?  forgot password
Advertisements
password check
password check  how to check sighup passowrd and login password
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
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
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
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
java password function
java password function  secret password function
Forgot Password of Application
Forgot Password of Application  Forgot Password of Application through servlet and jsp
coding for forgot password
coding for forgot password  coding for forgot password
Forgot Password of Application
Forgot Password of Application  i want sample code for Forgot Password of Application
password validation with special character
password validation with special character  how to validate password with special character using java script
servlet code to update password?
servlet code to update password?  Create a servlet page which helps the user to update his password. The user should give the username,old password,new password,confirm password. The updation is applicable only for valid
change kerberos principal password
change kerberos principal password  How to change the password... on the console and enter admin password. then you can use following command to change password: change_password abcd/mydomain.com It will ask for new
ModuleNotFoundError: No module named 'password'
ModuleNotFoundError: No module named 'password'  Hi, My Python... 'password' How to remove the ModuleNotFoundError: No module named 'password... to install padas library. You can install password python with following

Ads