52AV璈A|52AV.ONE

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

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

[銴鋆賡包
頝唾唳摰璅撅
璅銝
潸” 2014-12-11 21:02:57 | 芰閰脖 |芰憭批 撣 |摨閬 |梯璅∪
砍敺 IT_man 2014-12-11 22:31 蝺刻摩 ( S+ S, D' D+ x0 I

4 {8 Y2 \0 F& {$ U' Y
望潭蝬脩摮撖閬,閬銴撖瞍蝞瘜嚗甇日豢3DES撖
3DES撖(Triple DES)嚗臭撖瞍蝞瘜蝔梧3DES望蝔格芋撘嚗銝V蝝寧浩CB璅∪撖急
擐瑼X召inux臬行摰鋆mcrypt璅∠嚗寞憒銝:
' g7 y+ v( K+ O  h& R4 e
  1. rpm -qa | grep php-mcrypt
銴鋆賭誨蝣

% p+ F6 V8 W/ T0 t0 U" U其蝬脩撱箔php瑼嚗憒phpinfo.php(批捆憒銝)亦臬行mcrypt module

, C' S+ N/ ^* {) Y. ]
  1. <?php- P& U) j% u# @% O/ m. ]1 u
  2. // Show all information, defaults to INFO_ALL
    ( V. E" S3 V" V9 w
  3. phpinfo();
    7 c" Y, P# f2 O, q  }( i
  4. ?>
銴鋆賭誨蝣

1 m0 i! \. O/ u: v. x8 }+ o嗅嬌rowser 瑁phpinfo.php嚗蝯憒銝:
+ y! t' X% C$ O) @+ b
9 w* F8 _' {% H  O3 K" N+ F' m

8 q( x, h# |/ `9 y7 \
憒瘝摰鋆php-mcrypt嚗脰摰鋆(摰鋆寞)嚗摰鋆摰敺隞乩餈啣拍車寞銝隞交炎乓
銋敺撠勗臭誑啣神撖蝔撘憒銝嚗
0 [6 F* W" s6 M7 {/ B; U& k
  1. //撖賣豢啣神
    " ?' J! t! G' y) y
  2. function encrypt($source,$toencrypt){  7 s+ B, E! `" f1 Z; r) B1 L* t
  3. //撖函key   & }6 a5 V% n2 g1 P
  4. $key = $source;  
    : ?2 I5 w6 q1 R  h0 s8 E2 }8 P
  5. //雿輻3DES寞撖   
    3 z. f2 F% ]6 I. `  p) w
  6. $encryptMethod = MCRYPT_TRIPLEDES; 7 Z9 ~; s- o8 M+ u) b" f, ]
  7. //憪靘憓摰冽
    ) ~1 p+ F5 y( c- H, c
  8. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    % k( o) _. a4 k. Q( |
  9. //雿輻皂crypt_encrypt賣詨撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪
    7 Y: ?6 l% I4 r# ^6 G9 x: |
  10. $encrypted_toencrypt = mcrypt_encrypt($encryptMethod, $key, $toencrypt, MCRYPT_MODE_ECB,$iv);   " A8 _) R: b8 j! }
  11. //唾圾撖敺摮銝
    * B/ r# g3 z3 e9 S5 U& m$ l
  12. return base64_encode($encrypted_toencrypt);  $ x( `4 F# t4 D- |, T  r
  13. }  
    # [0 S* _9 S4 o& W$ B; ?4 {! {/ B
  14. //閫撖賣豢啣神
    1 R) z8 X  G/ U+ _+ x7 ?
  15. function decrypt($source,$todecrypt) {  / c, w; p7 M  U7 c+ h) u
  16. //閫撖函key嚗敹頝撖函key銝璅   ; ^- @( V- ?. Y% [9 w
  17. $key = $source;  
    + G2 K  v7 ~, e8 V  z8 d4 P0 h
  18. //閫撖閫base64蝣( i2 D( P) H  g' r$ l
  19. $todecrypt = base64_decode($todecrypt);2 F  F# H4 n* M: H
  20. //雿輻3DES寞閫撖
    8 ^- D; H/ F2 n0 I# b: }9 H
  21. $encryptMethod = MCRYPT_TRIPLEDES;    l* R* l% W7 w8 X' E; Q4 y. U
  22. //憪靘憓摰冽
    + O2 b* s( U. d, \# n( ^
  23. $iv = mcrypt_create_iv(mcrypt_get_iv_size($encryptMethod,MCRYPT_MODE_ECB), MCRYPT_RAND);  
    / O4 \8 @: l  u1 d& h9 m" f3 Q- r
  24. //雿輻皂crypt_decrypt賣貉圾撖嚗MCRYPT_MODE_ECB銵函內雿輻汞CB璅∪  # H. X- @5 {$ `" J* @! h/ H' n
  25. $decrypted_todecrypt = mcrypt_decrypt($encryptMethod, $key, $todecrypt, MCRYPT_MODE_ECB,$iv);
    4 I+ d+ `- \: n: J9 C/ E' n
  26. //唾圾撖敺摮銝
    * W  r2 P7 ^  n$ a2 x
  27. return $decrypted_todecrypt;  . Y2 y5 u: }! m! `4 T  r, `
  28. }  - s5 z3 o) ^5 W" [5 W
  29. //撖怠末閫撖賣訾敺嚗撠勗臭誑靘脰皜祈岫鈭/ s2 v& g1 N5 a: q) \
  30. //key閮剖: \; F. h1 X2 S% ^. v# I; O5 }# U
  31. $source ="1234567890";4 Y8 u1 i+ d# p. i( W
  32. //閬撖摮銝
    ' q' u9 A' n! B% I
  33. $string ="www.av4u.co";
    * y( M  g! i$ o) X6 p: I" v+ F4 w
  34. echo "string=".$string."<br>";. i/ C2 f9 h) O6 T5 Z/ [
  35. //脰撖銝阡*蝷箏撖敺摮銝
    1 g/ z- c. A% M$ {+ |0 F/ t5 h
  36. $encode = encrypt($source,$string);
    , \3 k  r7 U& O" G
  37. echo "encode=".$encode."<br>";: \* E! m& B7 h" U  J
  38. //脰閫撖銝阡*蝷箄圾撖敺摮銝) ~2 w, M& g; j; e* K/ F& v/ y
  39. $decode = decrypt($source,$encode);
    2 d$ l4 |# P- B- B1 Z
  40. echo "decode=".$decode."<br>";
銴鋆賭誨蝣

. `2 |* K( q! i
蝯憒銝:
4 N3 l0 k+ \$ E1 ^3 N# k, N

' g7 A' L3 u. M
瘜冽:
      憒閫撖蝔瘝雿輻灸ase64蝣潛閰梧頝函雯鞈唾撓嚗交嗥垢⊥閫霈(臬撖敺鞈唾撓航炊嚗雿臬典銝蝬脩抒閫撖舀憿)嚗蝯憒銝:

5 d" K7 |9 p; i8 p

雿輻券

祉蝛閬

BT蝳

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

QQ|撠暺撅||52AV璈A

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

蝯∠.撱

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

鋆貉憒 敹恍敺 餈銵