You are on page 1of 8

using using using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.Data.SqlClient; System.Data; System.Configuration; System.Security.Cryptography;

public partial class _Default System.Web.UI.!age " SqlConnection con # ne$ SqlConnection%Configuration&anager.ConnectionStrings'(con().ConnectionString*; protecte+ ,oi+ !age_Loa+%ob-ect sen+er. /,ent0rgs e* " 1 protecte+ ,oi+ btnSubmit_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; string pass # CipherUtility./ncrypt45i-n+ael&anage+6%7e8t9o8:.7e8t. (pass$or+(. (salt(*; SqlComman+ insertcm+ # ne$ SqlComman+%(insert into DataConsumer ,alues%;( < 7e8t9o8=.7e8t < (;.;( < pass < (;.;( < 7e8t9o8>.7e8t < (;.;( < 7e8t9o8?.7e8t < (;.;( < 7e8t9o8@.7e8t < (;.;( < 7e8t9o8A.7e8t < (;*(. con*; insertcm+./8ecuteBonCuery%*; con.Close%*; 5esponse.Write%(4script6alert%;Successfully Inserte+;*4Dscript6(*; 1 catch %/8ception* " 5esponse.Write%(4script6alert%;Bot Successfully Inserte+;*4Dscript6(*; 1 1 protecte+ ,oi+ btnClic2_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; SqlComman+ selctcm+ # ne$ SqlComman+%(select Username.!ass$or+ from DataConsumer(. con*; SqlData5ea+er +r # selctcm+./8ecute5ea+er%*; $hile %+r.5ea+%** " string uname # +r.GetString%E*; string pass # +r.GetString%=*; string pass$or+ # CipherUtility.Decrypt45i-n+ael&anage+6%pass. (pass$or+(. (salt(*; if %t8tUsername.7e8t ## uname FF t8t!ass$or+.7e8t ## pass$or+* " 5esponse.5e+irect%(DataConsumerGome.asp8(*; 1

1 1 catch %/8ception* " 1 1 1

using using using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.Data.SqlClient; System.Data; System.Configuration; System.Security.Cryptography;

public partial class _Default System.Web.UI.!age " SqlConnection con # ne$ SqlConnection%Configuration&anager.ConnectionStrings'(con().ConnectionString*; protecte+ ,oi+ !age_Loa+%ob-ect sen+er. /,ent0rgs e* " 1 protecte+ ,oi+ bbtngo_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; SqlComman+ selctcm+ # ne$ SqlComman+%(select !ublicHey.&asterHey.SecretHey.IileContent from Uploa+Iiles(. con*; Data7able +t # ne$ Data7able%*; SqlData0+apter s+a # ne$ SqlData0+apter%selctcm+*; s+a.Iill%+t*; int ro$count # +t.5o$s.Count; foreach%Data5o$ ro$ in +t.5o$s* " string p2ey # ro$'(!ublicHey().7oString%*; string m2ey # ro$'(&asterHey().7oString%*; string s2ey # ro$'(SecretHey().7oString%*; string content # ro$'(IileContent().7oString%*; DDstring pass$or+ # CipherUtility.Decrypt45i-n+ael&anage+6%pass. (pass$or+(. (salt(*; if %rbtnoption.Selecte+Jalue ## (E(* " if %t8t2ey.7e8t ## p2ey* "

7e8t9o8=.7e8t # content; 1 else if %rbtnoption.Selecte+Jalue ## (=(* " if %t8t2ey.7e8t ## m2ey* " DD con.3pen%*; SqlComman+ cm+ # ne$ SqlComman+%(select K from Uploa+Iiles $here &asterHey#;( < m2ey < (;(. con*; SqlData0+apter s+a= # ne$ SqlData0+apter%cm+*; DataSet +s+a # ne$ DataSet%*; s+a=.Iill%+s+a*; Gri+Jie$=.DataSource # +s+a; Gri+Jie$=.Data9in+%*; 1 1 else if %rbtnoption.Selecte+Jalue ## (:(* " if %t8t2ey.7e8t ## s2ey* " DDcon.3pen%*; SqlComman+ cm+ # ne$ SqlComman+%(select K from Uploa+Iiles $here SecretHey#;( < s2ey < (;(. con*; SqlData0+apter s+a= # ne$ SqlData0+apter%cm+*; DataSet +s+a # ne$ DataSet%*; s+a=.Iill%+s+a*; Gri+Jie$=.DataSource # +s+a; Gri+Jie$=.Data9in+%*; 1 1 1 1 catch %/8ception* " 1 1 protecte+ ,oi+ Gri+Jie$=_5o$Comman+%ob-ect sen+er. Gri+Jie$Comman+/,ent0rgs e* " if %e.Comman+Bame ## (+o$nloa+(* " int in+e8 # Con,ert.7oInt>:%e.Comman+0rgument*; Gri+Jie$5o$ ro$ # Gri+Jie$=.5o$s'in+e8); string filename # ro$.Cells'=).7e8t; string +ir # ro$.Cells':).7e8t; 5esponse.Clear%*; 5esponse.Content7ype # L(applicationMoctetNstream(; System.I3.IileInfo file # ne$ System.I3.IileInfo%Ser,er.&ap!ath%(ODUploa+e+D( < filename**; 5esponse.0++Gea+er%(ContentNDisposition(. (attachment; filename#( < file.Bame*; 5esponse.7ransmitIile%Ser,er.&ap!ath%(ODUploa+e+D( < filename**; 5esponse.Ilush%*; 1 1 1

using using using using using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.I3; System.7e8t; System.Data; System.Data.SqlClient; System.Configuration; System.Security.Cryptography; System.Web.UI.!age

public partial class _Default "

SqlConnection con # ne$ SqlConnection%Configuration&anager.ConnectionStrings'(con().ConnectionString*; protecte+ ,oi+ !age_Loa+%ob-ect sen+er. /,ent0rgs e* " 1 public ,oi+ btnStore_Clic2%ob-ect sen+er. /,ent0rgs e* " lbl&essage.7e8t # (Generating Heys to access the file(; string filename # IileUploa+=.!oste+Iile.IileBame; string filee8t # IileUploa+=.!oste+Iile.Content7ype; string path # Ser,er.&ap!ath%(ODUploa+e+D( < filename*; IileUploa+=.Sa,e0s%path*; string content # Iile.5ea+0ll7e8t%path*; string public2ey # Caesar%filename. P*; string master2ey # CipherUtility./ncrypt40es&anage+6%path. (clou+(. (salty(*; string fileattribute= # 7ransform%filename*; string fileattribute: # Caesar%filename.=P*; string secret2ey # CipherUtility./ncrypt40es&anage+6%content. (clou+(. (salty(*; t8tpblic.7e8t # public2ey; 7e8t9o8=.7e8t # fileattribute=; 7e8t9o8:.7e8t # fileattribute:; 7e8t9o8>.7e8t # master2ey; 7e8t9o8?.7e8t # secret2ey; 7e8t9o8@.7e8t # content; try " con.3pen%*; SqlComman+ insertcm+ # ne$ SqlComman+%(insert into Uploa+Iiles ,alues%;( < filename < (;.;( < filee8t < (;.;( < content < (;.;( < path < (;.;( < 7e8t9o8=.7e8t < (;.;( < 7e8t9o8:.7e8t < (;.;( < 7e8t9o8>.7e8t < (;.;( < 7e8t9o8?.7e8t < (;.;( < 7e8t9o8@.7e8t < (;*(. con*;

insertcm+./8ecuteBonCuery%*; con.Close%*; DD 5esponse.Write%(4script6alert%;Successfully Inserte+;*4Dscript6(*; 1 catch %/8ception* " 5esponse.Write%(4script6alert%;Bot Successfully Inserte+;*4Dscript6(*; 1 1 public static string Caesar%string ,alue. int shift* " char') buffer # ,alue.7oChar0rray%*; for %int i # E; i 4 buffer.Length; i<<* " DD Letter. char letter # buffer'i); DD 0++ shift to all. letter # %char*%letter < shift*; DD Subtract :A on o,erflo$. DD 0++ :A on un+erflo$. if %letter 6 ;Q;* " letter # %char*%letter N :A*; 1 else if %letter 4 ;a;* " letter # %char*%letter < :A*; 1 DD Store. buffer'i) # letter; 1 return ne$ string%buffer*; 1 public static string 7ransform%string ,alue* " char') array # ,alue.7oChar0rray%*; for %int i # E; i 4 array.Length; i<<* " int number # %int*array'i); if %number 6# ;a; FF number 4# ;Q;* " if %number 6 ;m;* " number N# =>; 1 else " number <# =>; 1 1 else if %number 6# ;0; FF number 4# ;R;* " if %number 6 ;&;* " number N# =>; 1

else " 1

number <# =>;

1 public ,oi+ btnuplo+_Clic2%ob-ect sen+er. /,ent0rgs e* " 5esponse.Write%(4script6alert%;Successfully Inserte+;*4Dscript6(*; 1 1

1 return ne$ string%array*;

1 array'i) # %char*number;

using using using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.Data; System.Data.SqlClient; System.Configuration; System.Security.Cryptography;

public partial class _Default System.Web.UI.!age " SqlConnection con # ne$ SqlConnection%Configuration&anager.ConnectionStrings'(con().ConnectionString*; protecte+ ,oi+ !age_Loa+%ob-ect sen+er. /,ent0rgs e* " 1 protecte+ ,oi+ btnSubmit_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; string pass # CipherUtility./ncrypt45i-n+ael&anage+6%7e8t9o8A.7e8t. (pass$or+(. (salt(*; SqlComman+ insertcm+ # ne$ SqlComman+%(insert into Data3$ner5eg ,alues%;( < 7e8t9o8=.7e8t < (;.;( < 7e8t9o8:.7e8t < (;.;( < 7e8t9o8>.7e8t < (;.;( < 7e8t9o8?.7e8t < (;.;( < 7e8t9o8@.7e8t < (;.;( < pass < (;.;( < 7e8t9o8S.7e8t < (;*(. con*; insertcm+./8ecuteBonCuery%*; con.Close%*; 5esponse.Write%(4script6alert%;Successfully Inserte+;*4Dscript6(*; 1 catch %/8ception* " 5esponse.Write%(4script6alert%;Bot Successfully Inserte+;*4Dscript6(*;

1 1 protecte+ ,oi+ btnClic2_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; SqlComman+ selctcm+ # ne$ SqlComman+%(select Domain3$ner.!ass$or+ from Data3$ner5eg(. con*; SqlData5ea+er +r # selctcm+./8ecute5ea+er%*; $hile %+r.5ea+%** " string uname # +r.GetString%E*; string pass # +r.GetString%=*; string pass$or+ # CipherUtility.Decrypt45i-n+ael&anage+6%pass. (pass$or+(. (salt(*; if %t8tUsername.7e8t ## uname FF t8t!ass$or+.7e8t ## pass$or+* " 5esponse.5e+irect%(Data3$nerGome.asp8(*; 1 1 1 catch %/8ception* " 1 1 1

using using using using using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls; System.Data.SqlClient; System.Data; System.Configuration; System.Security.Cryptography;

public partial class _Default System.Web.UI.!age " SqlConnection con # ne$ SqlConnection%Configuration&anager.ConnectionStrings'(con().ConnectionString*; protecte+ ,oi+ !age_Loa+%ob-ect sen+er. /,ent0rgs e* " 1 protecte+ ,oi+ btnSubmit_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; string pass # CipherUtility./ncrypt45i-n+ael&anage+6%7e8t9o8A.7e8t. (pass$or+(. (salt(*;

SqlComman+ insertcm+ # ne$ SqlComman+%(insert into Domain0uth ,alues%;( < 7e8t9o8=.7e8t < (;.;( < 7e8t9o8:.7e8t < (;.;( < 7e8t9o8>.7e8t < (;.;( < 7e8t9o8?.7e8t < (;.;( < 7e8t9o8@.7e8t < (;.;( < pass<(;.;( < 7e8t9o8S.7e8t < (;*(. con*; insertcm+./8ecuteBonCuery%*; con.Close%*; 5esponse.Write%(4script6alert%;Successfully Inserte+;*4Dscript6(*; 1 catch %/8ception* " 5esponse.Write%(4script6alert%;Bot Successfully Inserte+;*4Dscript6(*; 1 1 protecte+ ,oi+ btnClic2_Clic2%ob-ect sen+er. /,ent0rgs e* " try " con.3pen%*; SqlComman+ selctcm+ # ne$ SqlComman+%(select Username.!ass$or+ from Domain0uth(. con*; SqlData5ea+er +r # selctcm+./8ecute5ea+er%*; $hile %+r.5ea+%** " string uname # +r.GetString%E*; string pass # +r.GetString%=*; string pass$or+ # CipherUtility.Decrypt45i-n+ael&anage+6%pass. (pass$or+(. (salt(*; if %t8tUsername.7e8t ## uname FF t8t!ass$or+.7e8t ## pass$or+* " 5esponse.5e+irect%(Data3$ner5eg.asp8(*; 1 1 1 catch %/8ception* " 1 1 1

You might also like