52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩 : o) m! i4 H2 B2 z( w

6 j+ ^% h0 E, S) R0 G3 K  _
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:

. w* H2 e! |5 w( R8 L
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣
" z9 k2 {$ J4 S$ _
其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module
# e2 X- U  [9 h
  1. <?php5 y- c( `- U, x
  2. // Show all information, defaults to INFO_ALL
    . Y' P4 }& a) ]) ?) b& c1 P1 k
  3. phpinfo();* Z, Z' o( h( H* n8 ~# Y
  4. ?>
銴鋆賭誨蝣
, G' t# w2 p# H: R- k" t' R* d
嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:
; h' U$ i# `) R6 ?: ]" d
6 t( I1 ?& ?, W: G" H2 }1 r7 `
# j/ A! c! `6 o- L: A
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗

6 q4 [8 Q1 U7 O  ]3 E9 `( v0 I
  1. //撖賣豢啣神  ]5 O8 w. o% T. e
  2. function encrypt($source,$toencrypt){  8 [+ v( Z5 ^$ c  Q
  3. //撖函key   ; y. V: N( ^/ h5 H5 _5 o! A
  4. $key = $source;  
    6 S8 m! U2 p" U
  5. //雿輻3DES寞撖   $ g+ i4 d2 i$ Z
  6. $encryptMethod = MCRYPT_TRIPLEDES;
    0 o/ V: w1 w4 t6 L, u( Z& T( D
  7. //憪靘憓摰冽
      w- B0 f- L, j$ O: Q. z* g3 u. y
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    $ |. q# T: n" i- c- L# |0 ]
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪
    . }! L6 p$ z, I% e; P, j9 ^! B8 g8 B( y. q
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   1 N) f3 R+ s6 z5 L; d9 E
  11. //唾圾撖敺摮銝- o) P, r! Y9 V3 L: q& Q. W- K
  12. return base64_encode($encrypted_toencrypt);    |  u6 H( }3 z( U/ {9 A4 k* O
  13. }  
    $ K, T7 u) [0 `, Z7 p0 {
  14. //閫撖賣豢啣神% O+ X8 X- [1 a, @, Z6 y
  15. function decrypt($source,$todecrypt) {  9 z; h$ G2 I6 w) `  B0 G' g
  16. //閫撖函key嚗敹頝撖函key銝璅   " t5 O7 \6 W( ]6 O, _% B
  17. $key = $source;  
    . {$ I" I  k' R9 v& r+ ?/ ^2 L
  18. //閫撖閫base64蝣0 ^, @; k7 v: ^: T; F% _/ Y
  19. $todecrypt = base64_decode($todecrypt);
    * u/ ^9 g! w' u2 x7 i) D5 r
  20. //雿輻3DES寞閫撖
    ; z' A9 Y* e, L( R: N
  21. $encryptMethod = MCRYPT_TRIPLEDES;  
    - T3 X9 Q0 m8 d' _: T5 ]1 D
  22. //憪靘憓摰冽 7 _+ U9 g# S* U: ^/ Z2 |
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    ! c4 P, Z$ I0 y0 {8 y/ L
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  
    ; S. @& M2 e# O; H! z8 E
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);! E" K7 p6 U- b( r
  26. //唾圾撖敺摮銝
    5 k4 i) R0 ~6 S1 b1 |
  27. return $decrypted_todecrypt;  
    , n0 Z8 F, O$ o
  28. }  - A/ @8 q6 z8 c& S$ G/ m( X) S' ~2 `  W& y
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭8 {* o# p: a5 j  i
  30. //key閮剖
    * Q6 Z+ L9 P9 `# q' {
  31. $source ="1234567890";
    & x1 g# f, ~: s: ^# @7 [
  32. //閬撖摮銝( O+ l8 d) L0 r, K7 x; j1 p$ H$ A: g
  33. $string ="www.av4u.co";
    " L) F( J1 Q6 w" f# |$ A
  34. echo "string=".$string."<br>";7 |" i$ a; g) }' @- p
  35. //脰撖銝阡*蝷箏撖敺摮銝, T0 F3 d) x  H) L3 y, l
  36. $encode = encrypt($source,$string);& J) @( {$ k- n; n  m
  37. echo "encode=".$encode."<br>";
    % N+ s+ Q( N' w" a8 M: w
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝
    + R3 X( q" F2 N% O/ }* S" b& G
  39. $decode = decrypt($source,$encode);& q! W5 c' c. s9 r, }$ B, f+ k
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣

& T7 u6 e+ u; ^3 M  h% y. V
蝯憒銝:

, S. V  b# }3 V5 {

3 U$ c3 y, S1 S& q+ w9 u# w' @' |
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:

0 M1 b/ a! ?, q: p# e8 y- n  m

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

GMT+8, 2024-11-22 00:34 , Processed in 0.095434 second(s), 19 queries .

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵