نمایش نتایج 1 تا 15 از 15

نام تاپیک: مشكل با رمزنگاري كانكشن استرينگ

  1. #1
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    Smile مشكل با رمزنگاري كانكشن استرينگ

    سلام دوستان

    من به تازگي يك وبسايت آپلود كردم كه كانكشن استرينكش رو رمز نگاري كردم
    يكبار با DataProtectionConfigurationProvider
    و يكبار هم با RsaProtectedConfigurationProvider پروايدرها اما هر دو دفعه از من خطا گرفت
    خطاي مربرط به پروايدر دومي رو ميذارم


    Server Error in '/' Application.

    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened.

    Source Error:

    Line 1: <connectionStrings configProtectionProvider="RsaProtectedConfiguratio nProvider">
    Line 2: <EncryptedData Type="http://www.w3.org/2001/04/xmlenC#‎‎Element"
    Line 3: xmlns="http://www.w3.org/2001/04/xmlenC#‎‎">
    Line 4: <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenC#‎‎tripledes-cbc" />
    Source File: C:\Inetpub\whosts\iran....com\httpdocs\Connection. Config Line: 2

    Version Information: Microsoft .NET Framework Version:2.0.50727.3082; ASP.NET Version:2.0.50727.3082

    چكار كنم درست شه؟

    با تشكر
    آخرین ویرایش به وسیله sav68.net : جمعه 10 مهر 1388 در 21:24 عصر

  2. #2
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    دوستان لطفا كمك كنيد

    امنيت برنامم در خطر
    فكر كنم تا الان 40 50 نفر رفتن و پسورد ديتابيس رو برداشتن

  3. #3

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    سلام،
    من از این دو متد استفاده می‌کنم و مشکلی ندارم:

    public static string ProtectSection(string sectionName)
    {
    Configuration config = System.Web.Configuration.WebConfigurationManager.
    OpenWebConfiguration(HttpContext.Current.Request.A pplicationPath);

    ConfigurationSection section = config.GetSection(sectionName);
    if (section != null && !section.SectionInformation.IsProtected)
    {
    section.SectionInformation.ProtectSection("DataPro tectionConfigurationProvider");
    config.Save();
    return section.SectionInformation.IsProtected ? "Protected" : "Unprotected";
    }
    return "section not found.";
    }
    public static string UnProtectSection(string sectionName)
    {
    Configuration config = System.Web.Configuration.WebConfigurationManager.
    OpenWebConfiguration(HttpContext.Current.Request.A pplicationPath);

    ConfigurationSection section = config.GetSection(sectionName);
    if (section != null && section.SectionInformation.IsProtected)
    {
    section.SectionInformation.UnprotectSection();
    config.Save();
    return section.SectionInformation.IsProtected ? "Protected" : "Unprotected";
    }
    return "section not found.";
    }

  4. #4

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    سلام
    این فانکشن ها رو کجا باید بنویسیم؟
    ممنونم

  5. #5

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    بچه ها ، یکی توی همین تاپیک می گه چطوری می شه کانکشن استرینگی که رمزگذاری نشده ، هک کرد ؟

    فقط جون هر کی می پرستید ، از این حرف ها نزنید که هک خیلی کار زشتیه و توی این سایت نباید راجع بهش بحث بشه .

    ماها ناسلامتی می خوایم تو برنامه نویسی پیشرفت کنیم . پس هم باید بدونیم که دیگران چطوری هکمون می کنند و هم راه حلش رو بدونیم تا هک نشیم .

  6. #6

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    نقل قول نوشته شده توسط atbin2010 مشاهده تاپیک
    سلام
    این فانکشن ها رو کجا باید بنویسیم؟
    ممنونم
    فرق نمی‌کنه، کافیه فقط یک بار متد ProtectSection صدا زده بشه.
    UnProtectSection هم برای اینه که اگه زمانی Connection String روخواستین از حالت protect شده در بیارین اونو یک بار call کنید.

  7. #7
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    سلام

    آقا صابر مشكل من حل نشد

    اگر فايل web.config رو لوكال رمزگذاري كنم و بعد آپلودش كنم كه پيام زير رو ميده
    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Failed to decrypt using provider 'DataProtectionConfigurationProvider'. Error message from the provider: Key not valid for use in specified state. (Exception from HRESULT: 0x8009000B)

    Source Error:

    Line 1: <connectionStrings configProtectionProvider="DataProtectionConfigurat ionProvider">
    Line 2: <EncryptedData>
    Line 3: <CipherData>
    Line 4: <CipherValue

    .
    .
    .

    اگر هم كه آنلاين بخوام رمزكذاري كنم پيام زير رو ميده :
    Configuration Error

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: An error occurred loading a configuration file: Access to the path 'C:\Inetpub\whosts\iran....com\httpdocs\jslp1lw4.t mp' is denied.

    Source Error:

    [No relevant source lines]
    Source File: C:\Inetpub\whosts\iran....com\httpdocs\web.config Line: 0
    لطفا راهنمايي كنيد

    خيلي فوري است

  8. #8

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    این روش machine specific هست، یعنی باید روی خود سیستم عاملی انجام بگیره که وب‌سرور اونجا هست.
    نمی‌شه از توی کامپیوتر خودتون encrypt کنید و بعد روی server از اون استفاده کنید.

    در مورد error دوم، به دلیل دسترسی هست. ما چون روی dedicated server این کار رو کردیم این مشکل رو نداشتیم.
    Search کردم و دیدم چند forum نوشته به جای ConfigurationSection از ConnectionStringSettings استفاده کنید.
     ConnectionStringSettings _connectionStrings = System.Web.Configuration.WebConfigurationManager.C  onnectionStrings[connectionstringname];

  9. #9
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    ممنون كه جواب دادين

    چك ميكنم اگه بازم مشكلي بود مزاحمتون ميشم

  10. #10
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    سلام

    آقا من كدها رو بصورت زير تغيير دادم

    public static string ProtectSection(string sectionName)
    {
    Configuration config = System.Web.Configuration.WebConfigurationManager.
    OpenWebConfiguration(HttpContext.Current.Request.A pplicationPath);

    ConnectionStringSettings _connectionStrings =
    System.Web.Configuration.WebConfigurationManager.C onnectionStrings[sectionName];

    if (_connectionStrings != null && !_connectionStrings.SectionInformation.IsProtected )
    {
    _connectionStrings.SectionInformation.ProtectSecti on("DataProtectionConfigurationProvider");
    config.Save();
    return _connectionStrings.SectionInformation.IsProtected ? "Protected" : "Unprotected";
    }
    return "section not found.";
    }



    اما حالا خطاي زير رو ميده
    Compilation Error

    Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

    Compiler Error Message: CS0117: 'System.Configuration.ConnectionStringSettings' does not contain a definition for 'SectionInformation'

    Source Error:


    Line 118: System.Web.Configuration.WebConfigurationManager.C onnectionStrings[sectionName];
    Line 119:
    Line 120: if (_connectionStrings != null && !_connectionStrings.SectionInformation.IsProtected )
    Line 121: {
    Line 122: _connectionStrings.SectionInformation.ProtectSecti on("DataProtectionConfigurationProvider");
    Source File: f:\4 write\project\Iran...\Iran...SQLmemberShip\Secure\ Manage\SecurityConfig\Encryption.aspx.cs Line: 120
    لطفا بازم راهنمايي كن
    ان شالله يك در دنيا و 100 در آخرت

  11. #11
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    دوستان لطفا اگه كسي قبلا با اين مشكل روبرو شده كمك كنه
    .
    .
    يعني هيچ كس تا حالا كانكشن استرينگ رو توي هاست رمز گذاري نكرده؟

  12. #12
    کاربر تازه وارد آواتار sav68.net
    تاریخ عضویت
    بهمن 1387
    سن
    34
    پست
    98

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    هم اكنون نيازمند ياري سبزتان هستيم

    انجمن ...

  13. #13
    کاربر دائمی
    تاریخ عضویت
    اسفند 1384
    محل زندگی
    تهران
    پست
    1,629

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    نقل قول نوشته شده توسط sav68.net مشاهده تاپیک
    دوستان لطفا اگه كسي قبلا با اين مشكل روبرو شده كمك كنه
    .
    .
    يعني هيچ كس تا حالا كانكشن استرينگ رو توي هاست رمز گذاري نكرده؟
    با سلام
    من هم سعی کردم و موفق نشدم. یه تاپیک تو همین تالار زدم که جواب نگرفتم. روش کارم ظاهراً اشکالی نداره ( همه جا همین روش رو گفتن ). اما گمان می‌کنم اشکال از دسترسی فایل web.config باشه. هر چند که با control panel سایت هر چی دسترسی بود رو بهش دادم.

    صبا صبوحی

  14. #14
    کاربر دائمی آواتار eyes_shut_number1
    تاریخ عضویت
    اردیبهشت 1386
    محل زندگی
    http://blueco.ir
    سن
    38
    پست
    1,090

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    sectionName چی هستش؟ باید چی براش پاس بشه؟
    و این که کجا باید این کار رو کرد؟ فقط یک بار باید بشه!؟

    نقل قول نوشته شده توسط صابر مشاهده تاپیک
    سلام،
    من از این دو متد استفاده می‌کنم و مشکلی ندارم:

    public static string ProtectSection(string sectionName)
    {
    Configuration config = System.Web.Configuration.WebConfigurationManager.
    OpenWebConfiguration(HttpContext.Current.Request.A pplicationPath);

    ConfigurationSection section = config.GetSection(sectionName);
    if (section != null && !section.SectionInformation.IsProtected)
    {
    section.SectionInformation.ProtectSection("DataPro tectionConfigurationProvider");
    config.Save();
    return section.SectionInformation.IsProtected ? "Protected" : "Unprotected";
    }
    return "section not found.";
    }
    public static string UnProtectSection(string sectionName)
    {
    Configuration config = System.Web.Configuration.WebConfigurationManager.
    OpenWebConfiguration(HttpContext.Current.Request.A pplicationPath);

    ConfigurationSection section = config.GetSection(sectionName);
    if (section != null && section.SectionInformation.IsProtected)
    {
    section.SectionInformation.UnprotectSection();
    config.Save();
    return section.SectionInformation.IsProtected ? "Protected" : "Unprotected";
    }
    return "section not found.";
    }

  15. #15

    نقل قول: مشكل با رمزنگاري كانكشن استرينگ

    یک Page درست کنید (ترجیحاً password داشته باشد)،
    یک دکمه به اسم Protect و یک دکمه به اسم UnProtect در آن صفحه بگذارید.
    و رویداد کلیک را به این صورت بنویسید:
     Response.Write(ProtectSection("connectionStrings")  );

    بعد از upload کافی‌ست یک بار دکمه Protect را بزنید.

    البته مثل اینکه دوستان مشکل دسترسی داشتن.. ما روی dedicated server خودمان این کار را کردیم و مشکلی نداریم.

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •