52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |甇摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩
& w2 z" a0 ~7 f& I' l" ]/ d; W7 z# }( v3 P. c$ F
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:

8 t/ ]* v* j/ R3 q
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣
2 N& c9 W4 n- s
其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
% T: i" ~& E- n& N9 i
  1. <?php, s& K9 R+ }/ A
  2. // Show all information, defaults to INFO_ALL* V; M* x/ d  j8 S- K- e; e
  3. phpinfo();1 ]) p0 d5 h& g: a: R* L
  4. ?>
銴鋆賭誨蝣
4 }+ w; o0 s8 y. B- [$ z4 Q
嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:

1 ^: \; u1 m1 T8 E/ P$ X* e
2 x: R& _2 Z& p7 L  e' E3 B
1 t3 K. b7 S! U( s
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗
+ S  ]( f- n2 @! M
  1. //撖賣豢啣神
    # q  T0 J! u. h0 m' k
  2. function encrypt($source,$toencrypt){  
    ' t1 V- w8 ?. w* |( o5 r5 ~6 w
  3. //撖函key   : Y- H( G! e0 q
  4. $key = $source;    A2 F: O( A" O& d/ D1 |* V- j
  5. //雿輻3DES寞撖   
    1 J* x: D" w# v# q6 Z% w6 V
  6. $encryptMethod = MCRYPT_TRIPLEDES; + q/ Q! f4 Q2 Z% c1 K( u) ^
  7. //憪靘憓摰冽
    3 W& D# ]" f6 ]5 K+ ~  ^! M
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    ; K0 v1 G9 O. }% l; O5 H. x
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪
    : j/ n' r! \+ i4 M
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   ; x- }2 Q- m8 {& T
  11. //唾圾撖敺摮銝: g8 m) `; d5 L( l( I
  12. return base64_encode($encrypted_toencrypt);  & A/ ]6 i7 X6 w+ F; h
  13. }  
    1 @3 m' [4 g9 p/ k
  14. //閫撖賣豢啣神6 ~* H- i; g" [: A% U
  15. function decrypt($source,$todecrypt) {  ) m: C* ~+ _/ z
  16. //閫撖函key嚗敹頝撖函key銝璅   
    9 w4 E' V. I" {, w& A
  17. $key = $source;  
    . ?4 c, k6 N# n$ Q0 C" R" s. O
  18. //閫撖閫base64蝣! n, P. i. j! K+ B
  19. $todecrypt = base64_decode($todecrypt);2 E( O7 |2 D/ P+ A; u6 `
  20. //雿輻3DES寞閫撖
    $ R& \$ N' ~9 z% g, S% J
  21. $encryptMethod = MCRYPT_TRIPLEDES;  
    & C- W2 }; T2 U/ X: a2 [- s
  22. //憪靘憓摰冽 5 U; g# U- ^; t
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    ! }1 Q3 [' O% }8 b: u* V
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  
    , R% R0 d0 m+ M: B7 R! v+ F
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);8 A2 m  I; n, U2 |8 i0 {" i
  26. //唾圾撖敺摮銝9 [: B8 X' U# M; O
  27. return $decrypted_todecrypt;  ; P2 g8 S9 y( V; f! E  Z6 `
  28. }  
    . L& ~" d- T% f. U4 m6 Z1 V
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭
    9 O8 `8 @0 k2 W. D; A8 G8 {  X
  30. //key閮剖! b" l) f5 C& l! ]$ n# @( e+ @
  31. $source ="1234567890";8 Z( s  z6 p* W' p: t/ o
  32. //閬撖摮銝" |9 e  o  `2 @9 E8 O
  33. $string ="www.av4u.co";: a. @# {" k/ H2 L6 u; s
  34. echo "string=".$string."<br>";  l2 f# x* ^7 Y. Q9 b
  35. //脰撖銝阡*蝷箏撖敺摮銝# G1 [( v% a4 k1 c4 Z$ {& O
  36. $encode = encrypt($source,$string);
    0 ]4 g, k( S3 U6 |) e0 d% p8 M) n1 ^  t
  37. echo "encode=".$encode."<br>";6 s1 s& v0 g* q
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝
    , }. M! q  n1 o! e8 U- I! S# F
  39. $decode = decrypt($source,$encode);
    $ I) A  V) {" f& K" ?4 |
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣
) Z& j6 ]* L0 ], E- D. ]0 W
蝯憒銝:

2 N4 j7 k( f/ |2 u* U& u

1 d0 @2 ]# s3 I$ r4 m
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:

* s5 A  ]- L1 H4 g  e; j4 X* E6 m7 ~

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-22 00:48 , Processed in 0.074419 second(s), 20 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵