草庐IT

sha1_context

全部标签

c# - 如何在 C# 中使用 PBKDF2 HMAC SHA-256 或 SHA-512 使用 salt 和迭代对密码进行哈希处理?

我想找到一种解决方案或方法,允许我添加盐并控制迭代次数。nativeRfc2898DeriveBytes基于HMACSHA1。理想情况下,使用SHA-256或SHA-512将使系统经得起future考验。这是迄今为止我找到的最好的例子:http://jmedved.com/2012/04/pbkdf2-with-sha-256-and-others/但是当我用SHA-256运行它时,它实际上比SHA-512慢。我使用了64k次迭代、salt的guid和不同的相同长度的密码来进行比较。我还找到了这个解决方案:http://sourceforge.net/projects/pwdtknet

c# - RSACryptoServiceProvider(.NET 的 RSA)可以使用 SHA256 代替 SHA1 进行加密(不签名)吗?

加密时,RSACryptoServiceProvider(或.NET提供的任何其他RSA加密器)能否使用SHA256而不是SHA1?SHA1似乎是硬编码的,无法更改。例如,RSACryptoServiceProvider.SignatureAlgorithm被硬编码为返回“http://www.w3.org/2000/09/xmldsig#rsa-sha1”。如果没有办法让RSACryptoServiceProvider使用SHA256,有什么替代方案?更新以下代码运行良好,但我想将OAEPWithSHA1AndMGF1Padding更改为OAEPWithSHA256AndMGF1Pa

c# - 如何使用 Simple injector、Repository 和 Context - code first

我正在尝试使用SimpleInjector创建我的存储库并在业务逻辑层中使用它(我也想使用PerWebRequest方法)。在DAL层我有:publicinterfaceIRepositorywhereT:class{voidAdd(Tentity);voidDelete(Tentity);voidDelete(intid);voidUpdate(Tentity);TGetById(intId);IQueryableAll();IEnumerableFind(Funcpredicate);}和:publicclassEFRepository:IRepository,IDisposabl

c# - context.DeserializeTicket(token) 做什么?

我想了解刷新token的工作原理,我有一个很好的主意,这里有一个例子http://bit.ly/1n9Tbot,但我发现了这个context.DeserializeTicket(protectedTicket);我不确定它的作用,实际上没有任何文档,您可以在这里看到http://bit.ly/1y7LTHt是用来销毁token的吗?如果是“反序列化”,为什么不返回任何东西? 最佳答案 context.DeserializeTicket()类似于context.SetTicket()因为它们都设置了上下文的标签。区别在于Deseria

c# - 这个 Ambient Context 怎么会变成 null 呢?

谁能帮我解释一下TimeProvider.Current如何在下面的类中变为null?publicabstractclassTimeProvider{privatestaticTimeProvidercurrent=DefaultTimeProvider.Instance;publicstaticTimeProviderCurrent{get{returnTimeProvider.current;}set{if(value==null){thrownewArgumentNullException("value");}TimeProvider.current=value;}}public

c# - 扩展 ASP.NET 身份角色 : IdentityRole is not part of the model for the current context

我正在尝试在我的MVC5应用程序中使用新的ASP.NETIdentity,特别是我正在尝试将ASP.NETIdentity集成到现有数据库中。我已经阅读了有关DBFirst和ASP.NETIdentity的SO问题/答案,并且遵循了所有建议我仍然无法向我的数据库添加角色,尽管我在添加用户时没有问题。这是我的代码:varcontext=newPayrollDBEntities();varroleManager=newRoleManager(newRoleStore(context));boolroleExists=roleManager.RoleExists(roleDto.Name);

c# - The non-generic method cannot be used with type arguments in this context 是什么意思?

我有以下类和方法:publicclassUserManager:IDisposablewhereTUser:class,global::Microsoft.AspNet.Identity.IUserwhereTKey:global::System.IEquatable{publicvirtualTaskFindByIdAsync(TKeyuserId);和:privateApplicationUserManager_userManager;publicApplicationUserManagerUserManager{get{return_userManager??Request.Ge

c# - "This application can only run in the context of an app container."- Visual Studio 2015 开发新功能

我有点绝望。几个小时以来,我一直在努力解决以下问题。我开发了一个应用程序,我现在尝试使用VisualStudio2015的安装向导扩展来安装它。一切都在构建或(没有错误)但是当我打开应用程序时它突出显示它只能在应用程序容器的上下文中打开。那是什么意思?任何建议将不胜感激!该应用正在使用SQlite数据库。这可能与依赖关系有关吗?如果是这样,我该如何解决这个问题?更新:#Culture="en-US"ConvertFrom-StringData@'###PSLOCPromptYesString=&YesPromptNoString=&NoBundleFound=Foundbundle:{

c# - "Inspecting the state of an object in the debuggee of type System.Reflection.MethodBase is not supported in this context"

我不知道这个错误是什么意思。我使用的是VisualStudioforMac7.5.0社区版。我在带有ASP.NETCore的EntityFramework中使用延迟加载。publicpartialclassAdminUser{publicAdminUser(){RoleAssign=newHashSet();}publicGuidUserId{get;set;}publicstringFirstName{get;set;}publicstringLastName{get;set;}publicstringEmail{get;set;}publicstringUserName{get;s

c# - 为什么我的 PHP SHA256 哈希不等同于 C# SHA256Managed 哈希

为什么它们不一样?PHP:$hash=hash('sha256',$userData['salt'].hash('sha256',$password));c#publicstaticstringComputeHash(stringplainText,stringsalt){//Convertplaintextintoabytearray.byte[]plainTextBytes=Encoding.UTF8.GetBytes(plainText);byte[]saltBytes=Encoding.UTF8.GetBytes(salt);SHA256Managedhash=newSHA25