52AV璈A|52AV.ONE

 曉撖蝣
 蝡唾酉
敹急瑕
  • av隢憯BBS
  • 璈A
  • 芣瑟憭瘚
  • 鞎澆
  • 52av鋆貉摰
  • 銝剜-銝剖銝餅
Yahoo!憟拇撠
望: 璈A
Google憟拇撠
望: 璈A
     
亦: 4130|敺: 0
銝銝銝駁 銝銝銝駁

[蝬脤隡箸沘 Linux銝隞仙HP啣神 3DES(mcrypt) 撖寞(ECB璅∪)[3撘萄]

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩 " q( f) w1 Q# h) P: |0 m

) h  |  x' y& J0 l; |
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:
, o. g6 X) [  W
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣
8 \/ v" @2 a/ R" c4 v+ u
其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
( D) @! r& C% T9 ~
  1. <?php, N5 Z2 P4 u) d& n/ M
  2. // Show all information, defaults to INFO_ALL
    7 x3 k& [* [" M
  3. phpinfo();" _2 Z3 Q2 I# G" N$ C( r! J
  4. ?>
銴鋆賭誨蝣
2 a2 q/ M0 z) z) T
嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:
! d5 {, b9 b0 X) ?, ^5 v7 S$ N

. {1 B, ^4 p* N- t8 x

( s1 U% |' A6 D) U1 }) h
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗
( O" ?& Y# n4 l7 w6 _' C
  1. //撖賣豢啣神
    # s9 H; V' p! L& j  o, _5 z4 e! s
  2. function encrypt($source,$toencrypt){  $ {% S9 s- c% L( d+ Y* m
  3. //撖函key   
    2 S0 d8 P* v' W8 \
  4. $key = $source;  $ w& p* n' l( K" c1 e* G9 u% U
  5. //雿輻3DES寞撖   ; D5 |* |  E9 M) A2 z6 c1 h
  6. $encryptMethod = MCRYPT_TRIPLEDES;
    4 A! }; W! G; O- b3 ~8 E5 {
  7. //憪靘憓摰冽$ r. n3 R/ q/ U/ [0 @9 Q* ^
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  $ Z7 q, {8 {1 K
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪' N, c, Z4 d3 E+ Y3 y: p
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   
    " ?) E$ m9 F/ t1 o: J# j+ [* y, U
  11. //唾圾撖敺摮銝5 M; O: V& d3 d6 l# \, _. I! k
  12. return base64_encode($encrypted_toencrypt);  
    : {; R  t% v" E2 d1 w1 O7 K; `
  13. }  
    * P) B/ S: ]) ]( I0 d  ?
  14. //閫撖賣豢啣神: O! v7 w4 w/ I
  15. function decrypt($source,$todecrypt) {  
    & P/ A, M7 T3 d: g' P  w9 t
  16. //閫撖函key嚗敹頝撖函key銝璅   
    3 s/ d2 Z% S' S2 y- R* U: ~
  17. $key = $source;  
    7 y0 o4 \$ H) S$ H, P$ c. C
  18. //閫撖閫base64蝣
    * J3 r7 l) y0 ]' p! {# [
  19. $todecrypt = base64_decode($todecrypt);
    " |/ N- q0 g0 r! |6 D, F
  20. //雿輻3DES寞閫撖
    2 |6 T- U5 P! I- z
  21. $encryptMethod = MCRYPT_TRIPLEDES;  
    ( j% s1 U! U2 b" v: ?
  22. //憪靘憓摰冽
    ! a( I1 Z8 U1 e: n6 ^+ K6 ?* M
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  - a% b4 @8 J2 B% I% s
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  * i  a4 j4 w+ r6 B, p7 z
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);& ]: E. m% u% k: g" D) H& N
  26. //唾圾撖敺摮銝9 D8 F! w0 W0 K6 p$ p! M2 M
  27. return $decrypted_todecrypt;  ; y6 b9 a% x8 v, h' o; d
  28. }  
    ' ^  V0 W) @( }
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭
    : [# E5 ~: `) V5 d$ M! i3 b3 k* A. @
  30. //key閮剖- c) U, g) Z* B  Y
  31. $source ="1234567890";
    : ]3 Z1 X+ F- D! g! g* I( W
  32. //閬撖摮銝
    3 z: f( z6 |0 y
  33. $string ="www.av4u.co";
    ! [  U; i% C: [+ o- x7 P2 H
  34. echo "string=".$string."<br>";/ F+ W  T9 S: {/ Z
  35. //脰撖銝阡*蝷箏撖敺摮銝3 m( A& k# M: H, A) E
  36. $encode = encrypt($source,$string);$ |' p- w! l% C3 U3 v, x
  37. echo "encode=".$encode."<br>";2 j+ O1 k/ _7 H6 `! `2 q5 S
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝; `: U: [" [  I- P# I
  39. $decode = decrypt($source,$encode);
    ; i7 E9 r, t: q4 l5 P6 ^: X/ p
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣

; X2 u) v7 Z4 _- G5 X
蝯憒銝:
' s# m5 a$ N- f
8 m5 T- `5 D+ g8 q. _! b3 s9 V9 v
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:

6 O) b) F; F7 ?( I

雿輻券

祉蝛閬

BT蝳

砍憛批捆靘餉衣雯頝臬批捆蝝颲行粹嗥蝬脩嚗摰撟湔遛嚗嚗甇脖誑銝嗅啣摰嗆摰撟湧翩鈭箏ㄚ孵舫脣伐銝憿亙祉璇甈橘芣遛18甇 雓蝯脣亦閬賬粹脩芣遛18甇脖芣撟渡雯閬賜雯頝臭嗥批捆鞈閮嚗撱箄降典舫脰蝬脰楝批捆蝝蝯蝜ICRA蝝摰鋆閮剖 (粹蝯行霅 祉蝬脣銝蝝瘛函隢憯啣嚗祉閮剜蝞∠)

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-22 05:42 , Processed in 0.069859 second(s), 19 queries .

蝯∠.撱

52avtv@gmail.com | QQ:2405733034     since 2015-01

鋆貉憒 敹恍敺 餈銵