.NET Web.config Encryption Failing?

Feb 15, 2011

Here is what I do:

//First delete
aspnet_regiis -pz MyKeyName
//Create the container
aspnet_regiis -pc MyKeyName -exp
//Install the key into a machine-level RSA key provider
aspnet_regiis -pi MyKeyName pathToKeyFile
//Encrypt
aspnet_regiis -pef "connectionStrings" -prov pathToWebConfigFile

//So that's all good so far. If I want I can now decrypt which runs just fine on the same machine:
aspnet_regiis -pdf "connectionStrings"

I now take the Encrypted file and bring it to another machine and instal the same key (got from exporting my key using aspnet_regiis -px "MyKeyName" "C:MyKeyName.xml" -pri).

Now when I run the same decryption command I get an error " Decryption failed... Bad Data..."

View 1 Replies


Similar Messages:

Security :: Web.Config Encryption/decryption?

Mar 13, 2010

This is meant to be easy ...so ive been told, but still cant get it to work!I have a sql database hosted on a shared server which requires the use of sql authentication.As a result I require to encrypt my sensitive data in the config (connection strings etc).I understand that you can do this using aspnet_regiis etc, but ive been told that as I have no direct acccess to the server, I may need to program the encryption.
I have seen a few examples, but as a novice I have been banging away at this, looking at an errors screen most of the time!

View 18 Replies

Security :: How To Makle Encryption In Web.config

Oct 25, 2010

m trying to encrypt the <connectionStrings> in my web.config site using this code:

[Code]....

View 1 Replies

Configuration :: Custom Config Files Encryption

Mar 24, 2011

I have a couple of configuration files flxConnection.config and flxSecurity.config files which are being referenced from the Machine.config file like below.

<securitySettings configSource="flxSecurity.config" />
<connectionStrings configSource="flxConnection.config" />

I would like to encrypt the files (a) flxSecurity.config and (b) flxConnection.config using the RSAProtectedConfigurationProvider using a custom RSA key, which can be deployed to other servers. How is that possible? If possible, looked at a variety of stuff in the internet and they all seem to be referring to either Web.config or Machine.config encryption which is pretty straight-forward. This is how the flxConnection.config looks like,

<?xml version="1.0"?>
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>

This is how the flxSecurity.config looks like,

<?xml version="1.0" encoding="UTF-8"?>
<securitySettings>
<add key="APC_APP_ID" value="apcrpt"/>
</securitySettings>

View 3 Replies

Auto Encryption Of Web.config Connection String?

Apr 20, 2010

I want to encrypt the connection string in web.config, the problem is each time a developer changes the connection string in web.config and publishes, it needs to be encrypted every time in the web server. Is there any way that the connection string can encrypted automatically every time someone publishes it?

Note :- All of us work on our local machines other than the server. So encryption using local machine key is not an option.

View 1 Replies

Security :: Encryption Algorithm - Encryption Of Data Required In The Coding?

Sep 16, 2010

Not sure if I'm posting the question in the right category.

1) I'm working in a project where encryption of data is high priority. Could some one suggest what would be the best encryption method to protect data from being cracked.

I'm using TCP/IP protocol.

2) Is HTTPS totally secured. If I'm using HTTPS, does that mean that there is no encryption of data required in the coding?

View 3 Replies

Database Encryption Or Application Level Encryption?

Oct 23, 2010

When you need to store sensitive data such as CCs or SSNs, do you:1) Build your own encryption routine within the application, define a secret key somewhere in a config file, and then manually encrypt/decrypt data going to the database.2) Push all the problem to the database, using the built in DB capabilities (I think most vendors call it Transparent Database Encryption).What trade-offs have you find for your solution? Does writing your own routine perform poorly when compared to TDE? Is code maintainability, or conversely DB vendor lock-in an issue?

View 3 Replies

Failing In Email When Try To Send

Aug 8, 2010

now SqlCommand and its ExecuteNonQuery is it possible to do something like that with an email sending code to test what is failing in the email when you try to send it

View 2 Replies

Php - Ajax Post Failing In C#?

May 24, 2010

I'm trying to post to an external script using ajax so i can mail the data, but for some reason my data is not making it to the script.

$(document).ready(function() {
$("#submitContactForm").click(function () {
$('#loading').append('<img src="http://www.xxxxxxxx.com/demo/copyshop/images/loading.gif" alt="Currently Loading" id="loadingComment" />');
var name = $('#name').val();........

the php script is simple (for now - just wanted to make sure it worked)

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$to = 'xxxxx@xxxxx.com';
$subject = 'New Contact Inquiry';
$message = $comment;
mail($to, $subject, $message);
?>

the jquery is embedded in an .aspx page (a language i'm not familiar with) but is posting to a php script. i'm receiving emails properly but there is no data inside. am i missing something? i tried to bypass the variables in this example, but its still not working.

View 3 Replies

C# - Why Is File Uploading Failing In MVC

Feb 2, 2010

I am uploading files using HttpWebRequest to an ASP.Net MVC application but, for some reason unknown to me, it is failing to upload consistently.

I know the file is good since if you try enough times it does eventually upload and can be viewed on the server just fine. When it fails, neither the server nor client reports any errors directly related to the upload, the upload just stops partway through at a random location and time and my MVC action method is called without the file being loaded (Request.Files.Count == 0).

This only seems to be a problem in our production environment over DSL. The test and development environment works fine and the production environment works fine from in the office (really fast connection to servers) but fails when running it from home over DSL.

As you can see below, the point where it fails is basic.

[Authorize]
[AcceptVerbs(HttpVerbs.Put | HttpVerbs.Post)]
[ValidateInput(false)]
public int UploadScene(int sceneID, int tourID, string name, int number, PhotoType photoType)
{
SceneInfo scene;
if (Request.Files.Count < 1) throw new InvalidOperationException("Image file not uploaded.");
// process file...
}

View 2 Replies

C# - Response.redirect To Classic Failing

Jun 9, 2010

For some reason, the response.redirect seems to be failing and it is maxing out the cpu on my server and just doesn't do anything. The .net code uploads the file fine, but does not redirect to the asp page to do the processing. I know this is absolute rubbish why would you have .net code redirecting to classic asp, it is a legacy app. I have tried putting false or true etc. at the end of the redirect as I have read other people have had issues with this. it runs locally on my machine but won't run on my server! I am getting the following error when I debugged remotely.

View 6 Replies

Regular Expression (RegularExpressionValidator) Failing In IE 7?

Mar 16, 2011

This regular expression (stored in an ASP.NET regular expression validator) works fine in IE8 and firefox but fails in IE7: (?=.[0-9])(?=.[a-z]).{7,30}

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
ErrorMessage="Password criteria failed!" ControlToValidate="txtPassword"
ValidationExpression="(?=.*[0-9])(?=.*[a-z]).{7,30}" Display="Dynamic"
meta:resourcekey="RegularExpressionValidator1Resource1"></asp:RegularExpressionValidator>

View 1 Replies

AJAX :: Controls Failing To Load?

Feb 25, 2010

I have a website which uses the latest AJAX Control toolkit. On my pc, the website is loading perfectly well. The page makes use of a tab control and an update Panel - AJAX Control toolkit.Unfortunately when I uploaded the website online, on the shared web server, the website gives the following 3 errors (on IE) :

1) ASP.NET Ajax client-side framework failed to load
2) 'Sys' is unidentified
3) 'Sys' is unidentified

The page finally loads, however the ASP.NET Ajax controls do not load (Tab controls and UpdatePanel). The rest of the page loads perfectly well. I made some searches online, however still cant find a solution.

Facts:1. The site contains an Ajax Script Manager Proxy2. The web.config states that the site is not in debugging mode3. Tried to create a fresh new virtual directory and problem still persists. 4. On my Development machine the website is 100% functional.

View 3 Replies

Web Forms :: RequiredFieldValidator Failing For Some Users

Aug 24, 2010

Some times RequiredFieldValidator is failing to validate a calender textbox Field for date entry in the page so we receive a blank value in the email which the application sends and 1/1/1900 12:00:00 AM in the database for that corresponding control. It happened with a user who has got Internet Explorer and also the active Scripting is Enabled.

View 5 Replies

Control Events Failing To Fire?

Feb 17, 2011

I have a Page that does a LoadForm("blah.ascx"). The Page does have a ModalPopupExtender on it (It was on the ascx originally but I moved it to the Page as a test, doesn't work either way). There is a Loop here so the LoadControl() will be called multiple times and will put multiple instances of the ascx on the Page.

Blah.ascx has some buttons on it but when I click the buttons the click event does not fire and the Page gets reloaded without the control on it anymore.

The Page.Page_Load event does fire. And yes, I have the LoadControl() inside an Not IsPostback check. Just the controls events, including Page_Load, do not fire on postback, only on initial load.

View 6 Replies

Vb.net - Password Recovery Validation Failing In IE Only?

Mar 30, 2011

I'm using the ASP.NET Membership provider and using the Password Recovery control to reset the user password if they forget it. On the whole it all works fine, but with one catch when it comes to validation.

I have expanded the PasswordRecovery control out to use the template feature to customise the appearance, which is all fine. I have set the user lookup error handler using:

OnUserLookupError="PasswordRecovery1_UserLookupError"

in the opening tag and if I load up the page, type in some junk name and click submit this fires as expected, in all browsers. The snippet of VB code makes an error div visible and sets some text.

However, if upon loading the page for the first time I type a duff name into the username box and hit the enter key to submit the form, in Internet Explorer (version 8), the UserLookupError event fails to trigger. It triggers just fine in Chrome or Firefox, just not in IE. I know it's not a focus issue on the form, as I can see the form is being submitted.

If I click the submit button first, then following that hit the enter key it does fire, it's just that first time it doesn't, and only in IE.Also to add that if I set breakpoints in the VB code to check to see if the page is being submitted, I can see the Page_Load event fire when I hit the enter key, but not the sub PasswordRecovery1_UserLookupError. It looks like a bug in IE (no really???), but I need to nail it down.

View 1 Replies

C# - Response.TransmitFile Failing On First Download?

Oct 19, 2010

I have some code on an aspx page then when users loads the page it starts downloading a zip. Looks like this:

Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileSaveName);
Response.TransmitFile(zipPath);
Response.End();

The problem is the FIRST time this is hit I get the following error:

The zip file exists and is not in my wwwroot. If I refresh the page the file will download fine.

If I wrap the code in a Try Catch I get a System.Threading.Threadabort exception with the message:

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

NOTE: I actually get that exception every time. I guess its just to do with the Response.End

View 1 Replies

Insert Into Sql Query Failing In Code?

May 13, 2012

I have an Insert into function returns the error Syntax error (missing operator) in query expression when text the single quote  is send to the access db from a form. 

' I need to replace this with the ascii ' before the query is sent.

 here is the scode 
 
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.Buffer=True%>
<!-- #include file="Conn.asp" -->

[Code].....

here I need to handle fields having the only character is the single quote

View 1 Replies

C# - Encryption Of URL In 3.5?

Dec 2, 2010

How do I encrypt the URL while navigating in asp.net 3.5 ?

View 3 Replies

AJAX :: TabContainer Occasionally Failing To Draw?

Mar 2, 2010

Okay, so this is one of those annoying bugs that happens sometimes, but not with enough regularity to really root out.

Fair warning that I'm still just toddling in ASP.NET, so I could be doing something heartbreakingly stupid. Here's the gist:

I've got a page with the bulk of its content inside of a TabContainer from the AJAX Toolkit. There are a few page elements outside the TabContainer -- mostly just header/footer stuff from the master page. Sometimes the page will load (either initially or on a postback) and the TabContainer will completely fail to draw, leaving a mostly-empty page. Clicking "Reload" in the browser almost always makes everything appear as usual.

What would make a TabContainer occasionally fail to draw? How can I go about debugging this.

View 4 Replies

MVC :: Image Upload Failing In Google Chrome

Feb 10, 2010

I have an image upload form:

[Code]....

That posts back to the action
[Code]....

The code works accross all browsers but Google Chrome. My IDE is Visual Studio 2k8, and I haven't figured out how to debug on Google Chrome with it, however, I am throwing error messages, and I know that for some reason under chrome, the following check doesn't pass:
[Code]....

So apparently, under Chrome, the HttpPostedFileBase parameter picture isn't encoded right and loses its mime type, howwever, this might not be the only problem. What is excatly wrong with the HttpPostedFileBase parameter under Chrome, and how can I fix it?

View 3 Replies

SQL Stored Procedures Failing To Return Values?

Sep 7, 2010

I am working on a Tag system for a news page designed in ASP.NET. For the system I require a TagExists method to check for tags within the database. The stored procedure I have written is below.

[Code]....

I have tried switching the procedure to return 0 if the tag exists and 1 if it does not and it still returns 0 despite the exact same testing conditions. I have also returned the actual select query and it has complained of the Tag "news" (my test item) not being an int on execution showing the select itself is definitely properly formed.

View 3 Replies

DotNetOpenAuth Failing To Work On Live Server?

Apr 1, 2011

i worked on a sample application integrating OpenID into ASP.NET Web Forms. It works fine when hosted locally on my machine. However, when I uploaded the application to a live server, it started giving "Login Failed".

You can try a sample here: [URL]

Here is the source code that fails to process the OpenID response:

[code]....

View 1 Replies

Security :: Get WindowsIdentity Failing With Incorrect Function

Mar 25, 2010

i have this line of code

WindowsIdentity wi2 = new WindowsIdentity("test1");

test1 is in the ActiveDirectory on the DomainController

when running the code I get an IncorrectFunction error

at System.Security.Principal.WindowsIdentity.KerbS4ULogon(String upn)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName, String type)
at System.Security.Principal.WindowsIdentity..ctor(String sUserPrincipalName)
at Hisco.Intranet.LoginForm.OnInit(EventArgs e) in F:HiscoDCSWebEventsManagerHiscoDCSDCSLoginForm.aspx.cs:line 17
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I have windows auth for the website and outside users will logon that are not in the network and I need to impersonate them to login on without offering a login form( quietly behind the scenes) with the test account. I guess what I actually need is the UserTaken pointer. Is there a way to get one without ising the LogOnUser unmanaged call? I have a UserPrincipal object also so is there way to get the token from ActiveDirectory somehow?

View 2 Replies

Databases :: Loop Is Failing When Writing To Table?

Nov 16, 2010

My site extracts data from a MS SQL db and then connects to a mySql db which it writes the data to. My site is working properly when connecting to a db in cPanel at a remote website.

However, I have a mysql db also hosted on my site, and I'm connecting to it ok, but the loop is failing. There are 2 tables, one stores the category, and the other stores link data.

For each category

write to the category table
for each link in this category
write to the link table
next
next

The tables are being created, and the very first category is written to the table, but then nothing gets written to the link table.

How can I make this generate an error message? My webhost doesn't know what to do about it and they just want to see an error message.

I tried this once already, and neither of my lines worked:

HttpContext.Current.Response.Write(lnkid & " " & url)

Why doesn't that get written into the source of the page on each iterance of the loop? How do I see the data that isn't being written?

[Code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved