Safely use/store password in .NET core applicationHow to get “Manage User Secrets” in a .NET Core console-application?How can I get the application's path in a .NET console application?How should I ethically approach user password storage for later plaintext retrieval?How to store Node.js deployment settings/configuration files?Why not inherit from List<T>?How to deploy Profile with .net Core app on AWSWhat is the difference between .NET Core and .NET Standard Class Library project types?.NETStandard Library 1.6.0 dependency in .NET Core applicationBuild .NET Core console application to output an EXE?Raspbian -.net core application won't reload configurationIs using app.config and ConfigurationManager in .NET core advisable?

What should I do with the stock I own if I anticipate there will be a recession?

Shading faces depending on orientation

My father gets angry everytime I pass Salam, that means I should stop saying Salam when he's around?

Can I check a small array of bools in one go?

Does git delete empty folders?

What if a restaurant suddenly cannot accept credit cards, and the customer has no cash?

Levenshtein Neighbours

Metal that glows when near pieces of itself

What causes burn marks on the air handler in the attic?

How to render "have ideas above his station" into German

Number of matrices with bounded products of rows and columns

What allows us to use imaginary numbers?

From France west coast to Portugal via ship?

Adding things to bunches of things vs multiplication

Installing certbot - error - "nothing provides pyparsing"

My new Acer Aspire 7 doesn't have a Legacy Boot option, what can I do to get it?

Designing a prison for a telekinetic race

Airline power sockets shut down when I plug my computer in. How can I avoid that?

Output with the same length always

Do predators tend to have vertical slit pupils versus horizontal for prey animals?

Why should I pay for an SSL certificate?

Did they show Truman doing private things (toilet, etc) when filming him for 24 hours, 7 days a week?

Starships without computers?

Have made several mistakes during the course of my PhD. Can't help but feel resentment. Can I get some advice about how to move forward?



Safely use/store password in .NET core application


How to get “Manage User Secrets” in a .NET Core console-application?How can I get the application's path in a .NET console application?How should I ethically approach user password storage for later plaintext retrieval?How to store Node.js deployment settings/configuration files?Why not inherit from List<T>?How to deploy Profile with .net Core app on AWSWhat is the difference between .NET Core and .NET Standard Class Library project types?.NETStandard Library 1.6.0 dependency in .NET Core applicationBuild .NET Core console application to output an EXE?Raspbian -.net core application won't reload configurationIs using app.config and ConfigurationManager in .NET core advisable?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















I have a .NET core console application (not ASP.NET core) that uses a .NET Standard 2.0 class library.



I have a JSON configuration file that gets read out by the class library to setup something dynamically.



The application normally runs under the user that started the process (CredentialCache.DefaultNetworkCredentials) as scheduled task. But it is sometimes necessary that it should run under another account of a different user, for example to connect to an external system.



Of course I don't want to store the username and password (unencrypted) in the configuration. But what are my options. If I use a key, the key must be stored somewhere too, so it wouldn't be really secure.



I searched the web but haven't found a solution. I guess maybe the credential could be stored in the user or machine config instead of the json config? But I don't know if .NET core has access to this classes and the app should also work on other operating systems (like linux), that have the .NET core runtime installed.



Does anyone know a solution for this?










share|improve this question


























  • Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

    – Jürgen Müller
    Mar 27 at 13:39











  • There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

    – MindSwipe
    Mar 27 at 13:41












  • The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

    – Patric
    Mar 27 at 13:42











  • What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

    – Matthew
    Mar 27 at 13:44











  • It is SharePoint Online, but it could also be On-Premise.

    – Patric
    Mar 27 at 13:44

















2















I have a .NET core console application (not ASP.NET core) that uses a .NET Standard 2.0 class library.



I have a JSON configuration file that gets read out by the class library to setup something dynamically.



The application normally runs under the user that started the process (CredentialCache.DefaultNetworkCredentials) as scheduled task. But it is sometimes necessary that it should run under another account of a different user, for example to connect to an external system.



Of course I don't want to store the username and password (unencrypted) in the configuration. But what are my options. If I use a key, the key must be stored somewhere too, so it wouldn't be really secure.



I searched the web but haven't found a solution. I guess maybe the credential could be stored in the user or machine config instead of the json config? But I don't know if .NET core has access to this classes and the app should also work on other operating systems (like linux), that have the .NET core runtime installed.



Does anyone know a solution for this?










share|improve this question


























  • Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

    – Jürgen Müller
    Mar 27 at 13:39











  • There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

    – MindSwipe
    Mar 27 at 13:41












  • The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

    – Patric
    Mar 27 at 13:42











  • What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

    – Matthew
    Mar 27 at 13:44











  • It is SharePoint Online, but it could also be On-Premise.

    – Patric
    Mar 27 at 13:44













2












2








2








I have a .NET core console application (not ASP.NET core) that uses a .NET Standard 2.0 class library.



I have a JSON configuration file that gets read out by the class library to setup something dynamically.



The application normally runs under the user that started the process (CredentialCache.DefaultNetworkCredentials) as scheduled task. But it is sometimes necessary that it should run under another account of a different user, for example to connect to an external system.



Of course I don't want to store the username and password (unencrypted) in the configuration. But what are my options. If I use a key, the key must be stored somewhere too, so it wouldn't be really secure.



I searched the web but haven't found a solution. I guess maybe the credential could be stored in the user or machine config instead of the json config? But I don't know if .NET core has access to this classes and the app should also work on other operating systems (like linux), that have the .NET core runtime installed.



Does anyone know a solution for this?










share|improve this question
















I have a .NET core console application (not ASP.NET core) that uses a .NET Standard 2.0 class library.



I have a JSON configuration file that gets read out by the class library to setup something dynamically.



The application normally runs under the user that started the process (CredentialCache.DefaultNetworkCredentials) as scheduled task. But it is sometimes necessary that it should run under another account of a different user, for example to connect to an external system.



Of course I don't want to store the username and password (unencrypted) in the configuration. But what are my options. If I use a key, the key must be stored somewhere too, so it wouldn't be really secure.



I searched the web but haven't found a solution. I guess maybe the credential could be stored in the user or machine config instead of the json config? But I don't know if .NET core has access to this classes and the app should also work on other operating systems (like linux), that have the .NET core runtime installed.



Does anyone know a solution for this?







c# .net-core configuration-files credentials password-encryption






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 27 at 13:58









Matt.G

2,9742 gold badges4 silver badges16 bronze badges




2,9742 gold badges4 silver badges16 bronze badges










asked Mar 27 at 13:29









PatricPatric

1,2386 gold badges19 silver badges43 bronze badges




1,2386 gold badges19 silver badges43 bronze badges















  • Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

    – Jürgen Müller
    Mar 27 at 13:39











  • There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

    – MindSwipe
    Mar 27 at 13:41












  • The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

    – Patric
    Mar 27 at 13:42











  • What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

    – Matthew
    Mar 27 at 13:44











  • It is SharePoint Online, but it could also be On-Premise.

    – Patric
    Mar 27 at 13:44

















  • Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

    – Jürgen Müller
    Mar 27 at 13:39











  • There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

    – MindSwipe
    Mar 27 at 13:41












  • The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

    – Patric
    Mar 27 at 13:42











  • What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

    – Matthew
    Mar 27 at 13:44











  • It is SharePoint Online, but it could also be On-Premise.

    – Patric
    Mar 27 at 13:44
















Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

– Jürgen Müller
Mar 27 at 13:39





Do you need to encrypt the pwd during runtime (via your application)? Or do you need to decrypt only?

– Jürgen Müller
Mar 27 at 13:39













There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

– MindSwipe
Mar 27 at 13:41






There is no way to safely and reversibly store information locally, you could encrypt it, but then again the encrypted files are there and vulnerable to rainbow table lookups, also the attacker has access to the binaries, using a decompiler he could look at your private key. You could go with security through obscurity but that's even worse. So question boils down to this, will the application need to do this automatically or will this process always be initiated by a user?

– MindSwipe
Mar 27 at 13:41














The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

– Patric
Mar 27 at 13:42





The application is not run by a user, it is run scheduled. So I only need to decrypt it. I have found the following post: stackoverflow.com/questions/42268265/… which I am currently studying, I think it goes into the right direction.

– Patric
Mar 27 at 13:42













What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

– Matthew
Mar 27 at 13:44





What is the system that you're trying to connect to? There may be an option that doesn't require sending username + password.

– Matthew
Mar 27 at 13:44













It is SharePoint Online, but it could also be On-Premise.

– Patric
Mar 27 at 13:44





It is SharePoint Online, but it could also be On-Premise.

– Patric
Mar 27 at 13:44












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55378434%2fsafely-use-store-password-in-net-core-application%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55378434%2fsafely-use-store-password-in-net-core-application%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript