Happy mom--php mysqli des encryption

Source: Internet
Author: User
Tags crypt decrypt

The future female: likes the movie, likes reading, has a small dream is to be a director, leads a own favorite film. Vegetarian more, delicious meat also can eat, favorite dish is sweet and sour pork ribs, cola chicken wings like sweets. Do not like to eat takeout, like the feeling of home. Like Portman and let Renault.

Was she sent by heaven? Omg

After reading "Love You Like Love Life" this book, really see the wavelet brother very have, with the wavelet elder brother, I only take the shot may be I than his Yan value. Think of a word, people are not because of beautiful and lovely, but because lovely and beautiful. So what I ask of me is, keep practicing.

Today by PHP mysqli database connection and query, get the head good headache. There is a query $conn->query ($sql); return is always false. Well, I named this query exactly the same, and that works. It seems to have been targeted again. And then put it on the solution.

Share this Java encryption can be decrypted program, personally used, can not use the default JDK, otherwise there is an error.

1 Importjava.io.IOException; 2 ImportJava.security.SecureRandom; 3 ImportJavax.crypto.Cipher; 4 ImportJavax.crypto.SecretKey; 5 Importjavax.crypto.SecretKeyFactory; 6 ImportJavax.crypto.spec.DESKeySpec; 7 ImportSun.misc.BASE64Decoder; 8 ImportSun.misc.BASE64Encoder; 9  Public classDes {Ten    One     Private byte[] deskey;  A    -      PublicDes (String deskey) { -          This. Deskey =deskey.getbytes ();  the     }   -    -      Public byte[] Desencrypt (byte[] plaintext)throwsException { -SecureRandom sr =NewSecureRandom ();  +         byteRawkeydata[] =Deskey;  -Deskeyspec DKs =NewDeskeyspec (Rawkeydata);  +Secretkeyfactory keyfactory = secretkeyfactory.getinstance ("DES");  ASecretkey key =Keyfactory.generatesecret (DKS);  atCipher Cipher = cipher.getinstance ("DES");  - Cipher.init (Cipher.encrypt_mode, Key, SR);  -         byteData[] =plaintext;  -         byteEncrypteddata[] =cipher.dofinal (data);  -         returnEncryptedData;  -     }   in    -      Public byte[] Desdecrypt (byte[] encrypttext)throwsException { toSecureRandom sr =NewSecureRandom ();  +         byteRawkeydata[] =Deskey;  -Deskeyspec DKs =NewDeskeyspec (Rawkeydata);  theSecretkeyfactory keyfactory = secretkeyfactory.getinstance ("DES");  *Secretkey key =Keyfactory.generatesecret (DKS);  $Cipher Cipher = cipher.getinstance ("DES"); Panax Notoginseng Cipher.init (Cipher.decrypt_mode, Key, SR);  -         byteEncrypteddata[] =Encrypttext;  the         byteDecrypteddata[] =cipher.dofinal (EncryptedData);  +         returnDecrypteddata;  A     }   the    +      PublicString Encrypt (String input)throwsException { -         returnBase64Encode (Desencrypt (Input.getbytes ()));  $     }   $    -      PublicString decrypt (String input)throwsException { -         byte[] result =Base64decode (input);  the         return NewString (Desdecrypt (result));  -     }  Wuyi    the      Public StaticString Base64Encode (byte[] s) { -         if(s = =NULL)   Wu             return NULL;  -Base64encoder B =NewSun.misc.BASE64Encoder ();  About         returnB.encode (s);  $     }   -    -      Public Static byte[] Base64decode (String s)throwsIOException { -         if(s = =NULL)   A             return NULL;  +Base64decoder decoder =NewBase64decoder ();  the         byte[] B =Decoder.decodebuffer (s);  -         returnb;  $     }   the    the      Public Static voidMain (string[] args)throwsException { theString key = "ABCDEFGH";  theString input = "a";  -Des crypt =NewDes (key);  inSystem.out.println ("Encode:" +crypt.encrypt (input));  theSystem.out.println ("Decode:" +Crypt.decrypt (Crypt.encrypt (input)));  the     }   About}

Today is my mother's birthday, I am grateful that she set up my three views, I hope she can in the future every day to have a happy, happy.

So today, Bing Xin's "poem To Mother" gave her

Mother, long time since

I wanted to write a poem for you.

But it's been written many times.

It's still not written.

Mother, I wrote this poem for you.

I don't know how to start

I don't know how to end it.

And I don't know what to write.

It's like a tough slap in the face of your childhood.

I don't know if I should be brave enough to accept

Or should I choose to escape?

Mother, tonight I think of you again

I've decided to write a poem for you.

Even if it wasn't written well.

Even if you're far from home

Can never read ...

Mother

If you see a small white boat in your dream,

Don't be surprised at his dreaming.

This is your beloved daughter (son left) with tears in his mouth,

Lakes

Begging him to carry her love and sorrow to return.

  

Happy mom--php mysqli des encryption

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.