- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
这是我的场景和问题:
我试着在网上寻找一个好的资源,但其中大部分都不完整,而且彼此之间差异很大,以至于它们无法真正混合搭配。我希望使用 WCF 服务来传递来 self 的客户端/服务器的加密消息。我也将实现一些自定义身份验证方案。身份验证方案将在第一次身份验证时验证用户/通过。然后从那时起,客户端将使用随机生成的代码作为他们的身份验证。
根据我收集到的信息,我需要执行以下操作:
[ServiceContract(ProtectionLevel = ProtectionLevel.EncryptAndSign)]
这是我有点不知所措的地方。有太多的资源说明服务器和客户端的配置文件应该如何,我真的很困惑。我的服务器/客户端配置文件应该是什么样子,以便我的服务发送/接收加密消息并可以指向自定义身份验证?
如果那里有一个实际的、完全完整的(即不是部分信息)资源,那就太好了。或者,如果有人知道要使用的必要客户端/服务器 App.config/Web.config 设置,那也很好。
最佳答案
我相信您希望使用 HTTPS 来确保传输级别的加密和签名。您需要首先使用 SSL 证书配置 IIS7.5,并在托管服务的应用程序中允许 https。检查this tutorial但您将使用现有证书而不是创建自签名证书。您的证书应该为您网站的主机 header (例如 mydomain.com)或直接公开的服务器名称创建。
在您的服务中,您需要带有传输安全和消息凭证的 basicHttpBinding 以进行身份验证。
<bindings>
<basicHttpBinding>
<binding name="secured">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="securedService">
<serviceMetadata httpsGetEnabled="true" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" userNamePasswordValidator="..." />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="..." behaviorConfiguration="securedService">
<endpoint address="" contract="..." binding="basicHttpBinding" bindingConfiguration="secured" />
<endpoint address="mex" contract="IMetadataExchange" binding="mexHttpsBinding" />
</service>
</services>
客户端将使用类似的设置:
<bindings>
<basicHttpBinding>
<binding name="secured">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint name="..." address="https://..." contract="..." binding="basicHttpBinding" bindingConfiguration="secured" />
</client>
此配置定义了 SOAP 1.1 服务,该服务符合通过 HTTPS 传输保护并受用户名和密码保护。服务还通过 HTTPS 公开其元数据 (WSDL)。用户名和密码由自定义密码验证器验证(您必须 implement one )。
您将在客户端设置凭据(由添加服务引用生成):
var client = new MyServiceClient();
client.ClientCredentials.UserName.UserName = "Name";
client.CleintCredentials.UserName.Password = "Password";
消息的加密是在传输层完成的。每次创建新代理时都必须配置凭据,但它们会重复用于来自代理的所有调用。
您的方案可能不需要 WsHttpBinding。设置 ProtectionLevel
仅用于消息级安全性 - 我认为这不是您要找的。
不要使用您描述的自定义身份验证:
The authentication scheme will verify the user/pass on the first time authentication. Then from then on the client will use a randomly generated code as their authentication instead.
要复杂得多。您将推出自己的非标准解决方案,或者您将使用 WCF 的内置实现(安全对话),但并非每个客户端 SOAP 堆栈都能够使用此类服务(它完全依赖于高级消息安全性)。
关于WCF - 使用 SSL 的加密(可能还有身份验证),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5861086/
我正在使用框架的对象编写一个用于加密/解密的简单库。方法如下: public static byte[] Encrypt(byte[] key, byte[] vector, byte[] input
据我所知,RIM Crypto API 似乎只提供用于对称加密 (3Des) 的 PKCS5 填充模式。我正在使用 JDE 4.6.0。 我正在尝试为黑莓应用程序提供密码学,该应用程序需要与已经使用标
我已经获得了用于加密的 Java 实现,但遗憾的是我们是一家 .net 商店,我无法将 Java 整合到我们的解决方案中。可悲的是,我也不是 Java 专家,所以我已经为此苦苦挣扎了几天,我想我终于可
我正在尝试使用 KMS 和 AWS 加密 SDK 加密数据。查看 AWS documentation 中提供的示例,似乎没有地方可以明确设置数据 key 。 我找到了 EncryptionMateri
我目前有一个用于为我的网站制作哈希的代码,该代码使用 SALT 进行哈希处理,因此密码是不可逆的...... 目前它是 100% 为我的网站工作,它是使用 ASP.NET(C#) 编码的 这是我的代码
我想要做的是在 javascript 中生成一个 key 对,并在 PHP 中使用这些加密,然后用 JS 解密。 我在附加的代码中有两个问题 它不会从装甲文本块重新加载私钥 并且它不会解密 PHP 加
在进行密码哈希时,我有以下 node.js 代码。 body.password = covid@19 salt = "hello@world" body.passwordhex = crypto.cr
我想知道的是在配置文件中加密连接字符串的明确方法。以下是我的问题: 使用机器级加密,访问我的服务器的任何人都不能编写一个小的 .Net 程序来读取连接字符串的内容吗? 如果我将我的应用程序部署到企业环
我知道 rsync 可以在文件传输期间启用/禁用 ssh 加密协议(protocol)。那么,如果 ssh 加密协议(protocol)被禁用了,是不是意味着 rsync 根本不做任何加密呢? 另外,
脚本必须搜索网页内的字符串。但该脚本不应显示它正在搜索的字符串。我的意思是搜索字符串应该采用加密格式或任何其他格式。但如果没有该搜索字符串,则不应显示网页或应在页面上显示错误。 我要开发一个插件。如果
我正在尝试加密 MySQL 上的某些字段。我正在使用 TPC-DS 的 v2.8 版本,并尝试在客户地址表的某些列上使用 AES。知道如何加密字段的所有行吗?我尝试使用 UPDATE customer
我需要一个简单的 javascript 函数,它允许我使用 key 加密 textarea 数据( key 是存储为散列 session 变量的用户密码,由 PHP 打印到字段中) 我基本上希望在用户
如何在 JavaScript 中散列/加密字符串值?我需要一种机制来隐藏 localStorage/cookie 中的一些数据吗? 这与安全问题有关,但我想为我的数据提供一些保护。 最佳答案 有很多
我有一个程序,其中数据库的密码由远程用户设置。该程序将用户名和密码保存到 xml 文件中的加密字符串中,否则应该是人类可读的。现在,这工作正常,我使用带有 key 的 C# DES 加密,它被加密和解
Kotlin 中是否有任何关于椭圆曲线加密的信息? 用于生成 key 对和加密、解密消息。 关于这个主题的信息很少甚至没有。 例如,我想实现 ECC P-521 椭圆曲线。 是否可以在 Kotlin
所以我知道 MD5 在技术上是新应用程序的禁忌,但我随机想到了这个: 自 md5($password); 不安全,不会 md5(md5($password)) 是更好的选择?我使用它的次数越多,它会变
我一直在努力使用 crypto_secretbox_easy() 在 libsodium 中加密/解密一些数据| .我似乎找不到关于使用的任何好的文档。 我想从用户那里获取密码,用它来以某种方式制作
我正在做一个加密项目 视频,我对这个程序有几个问题。 我用命令转码mp4至HLS与 ts段持续时间约为 10 秒。 首先,我需要使用数据库中的 key 加密这些视频。然而, 我不知道是否使用 ffmp
我有一个加密/复制保护问题。 我正在为使用加密狗的公司编写应用程序。请不要告诉我软件保护是没有用的,或者我应该让它自由地飞向空中,或者我花任何时间这样做都是浪费;这不是关于软件保护有效性的哲学问题,更
我对 有一个疑问VIM 加密 key . 我有一个文本文件,我使用加密该文件 :X 现在,加密 key 的存储位置(路径)。 无论是存储在单独的文件中还是存储在文本文件本身中。 如果我打开文件,它会询
我是一名优秀的程序员,十分优秀!