Email Development--base64 Account password conversion

Source: Internet
Author: User

1  Packagecom.hq.base64;2 3 ImportJava.io.BufferedReader;4 ImportJava.io.FileInputStream;5 Importjava.io.FileNotFoundException;6 ImportJava.io.FileOutputStream;7 Importjava.io.IOException;8 ImportJava.io.InputStreamReader;9 Importjava.io.UnsupportedEncodingException;Ten Importjava.util.Properties; One  A ImportJavax.activation.DataHandler; - ImportJavax.activation.DataSource; - ImportJavax.activation.FileDataSource; the Importjavax.mail.Address; - ImportJavax.mail.Authenticator; - ImportJavax.mail.Message; - Importjavax.mail.MessagingException; + Importjavax.mail.PasswordAuthentication; - Importjavax.mail.Session; + ImportJavax.mail.Transport; A ImportJavax.mail.Message.RecipientType; at Importjavax.mail.internet.AddressException; - Importjavax.mail.internet.InternetAddress; - ImportJavax.mail.internet.MimeBodyPart; - ImportJavax.mail.internet.MimeMessage; - ImportJavax.mail.internet.MimeMultipart; - Importjavax.mail.internet.MimeUtility; in  -  to  +  - ImportSun.misc.BASE64Encoder; the  *  Public classBase64util { $ Panax Notoginseng     /** -      * @paramargs Add by zxx, Dec the      * @throwsIOException +      */ A      Public Static voidMain (string[] args)throwsIOException { theBase64encoder encoder =NewBase64encoder (); +SYSTEM.OUT.PRINTLN ("Please input user name:"); -String username =NewBufferedReader ( $                     NewInputStreamReader (system.in)) $ . ReadLine (); - System.out.println (Encoder.encode (Username.getbytes ())); -SYSTEM.OUT.PRINTLN ("Please input password:"); theString Password =NewBufferedReader ( -                 NewInputStreamReader (system.in))Wuyi . ReadLine ();  the System.out.println (Encoder.encode (Password.getbytes ())); -     } Wu}

Base64 is one of the most common encoding methods for transmitting 8Bit bytes of code on the network, and you can view rfc2045~rfc2049, which has a detailed specification of MIME. BASE64 encoding can be used to pass longer identity information in an HTTP environment. For example, in the Java Persistence System hibernate, Base64 is used to encode a long unique identifier (typically 128-bit uuid) as a string that is used as a parameter in an HTTP form and an HTTP GET URL. In other applications, it is often necessary to encode binary data as appropriate in the form of URLs (including hidden form fields). At this time, the use of BASE64 encoding is not readable, that is, the encoded data will not be directly visible to the naked eye.

Email Development--base64 Account password conversion

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.