rsa

Calculation for status in Archer GRC based on date

妖精的绣舞 提交于 2020-01-24 13:45:50
问题 Trying to create a status field based on a number of Value Lists that users select from, but a request has been made that we check a date field for a value to ensure an estimated date has been set so that the calculation can determine if the status of the record is "In Progress", "Late" or "Not Started". 回答1: You can try using the ISEMPTY() function within your calculated field to verify that the date field contains a value. Then, use the DATEDIF function to determine if record is late or in

Why isn't RSA signing usually used in RESTful apis?

眉间皱痕 提交于 2020-01-23 07:35:14
问题 I develop a simple app that doesn't use (at least, at first) any third-party authorization. I want to create a RESTful api to be used by iOS/Android/whatever clients, so I've read a bunch of information about implementation of RESTful APIs. However, the usual ways of implementing them involve sending some sort of secure "token" that is used to sign the requests; this leaves the API vulnerable to man-in-the-middle attack, and recommended way to counter it is to use HTTPS. However, reading all

Java加解密之RSA

耗尽温柔 提交于 2020-01-23 03:19:21
Java加解密之RSA RSA加解密需要有公钥,私钥;可以使用公钥加密,私钥解密;也可以使用私钥加密,公钥解密。私钥加密相同的数据密文相同,公钥加密相同的数据密文不同。 import org . apache . commons . codec . binary . Base64 ; import org . slf4j . Logger ; import org . slf4j . LoggerFactory ; import javax . crypto . BadPaddingException ; import javax . crypto . Cipher ; import javax . crypto . IllegalBlockSizeException ; import javax . crypto . NoSuchPaddingException ; import java . security . * ; import java . security . interfaces . RSAPrivateKey ; import java . security . interfaces . RSAPublicKey ; import java . security . spec . InvalidKeySpecException ; import java .

RSA decryption error - IllegalBlockSizeException: Data must not be longer than 128 bytes

雨燕双飞 提交于 2020-01-22 05:56:29
问题 I am now on making RSA message authentication software. The process is as follows: Sign the message by using A's private key (1024 bit) Verify the message by using A's public key (1024 bit) The #1 code (below) works fine and generates following result:

PHP实现RSA2加密

限于喜欢 提交于 2020-01-22 05:20:39
因为做支付宝APP支付需要把订单信息结合支付密钥进行加密,所以需要一个完成加密的接口。 整体代码下面会有,不过在代码之前有几个需要注意的点。 首先,php扩展openssl需要打开,这个可以phpinfo查看是否开启。 Linux宝塔是上安装的php是默认开启的 接着,在php.ini文件中搜索extension,找到extension = openssl去掉前面的冒号 在phpstudy中是extension = openssl.dll 这里有一点,好多博文都没有提到,所以我踩过这个坑。(就是密钥和公钥的格式问题) private static $PRIVATE_KEY = <<<EOD -----BEGIN RSA PRIVATE KEY----- 这里是密钥内容 -----END RSA PRIVATE KEY----- EOD; private static $PUBLIC_KEY = <<<EOD -----BEGIN PUBLIC KEY----- 这里是公钥内容 -----END PUBLIC KEY----- EOD; 如果想把代码放到.pem文件中,也用这种格式,之后使用file_get_contents()函数获取到即可 还有一点需要注意,PHP传参会自动转义,如果是把加密功能写成一个接口,那么需要加密的数据就会以参数的形式传进来,就需要解决PHP转义这个问题。

主机漏洞-SSL/TLS 受诫礼(BAR-MITZVAH)***漏洞(CVE-2015-2808)【原

↘锁芯ラ 提交于 2020-01-22 01:46:09
一、漏洞分析 事件起因 2015年3月26日,国外数据安全公司Imperva的研究员Itsik Mantin在BLACK HAT ASIA 2015发表论文《Attacking SSL when using RC4》阐述了利用存在了13年之久的RC4漏洞——不变性弱密钥(《Weakness in the Key Scheduling Algorithm of RC4》,FMS 发表于2001年)进行的***,并命名为“受戒礼”***(Bar Mitzvah Attack)。 直到2015年3月,还有约30%的网络通信是由RC4进行保护的。通过“受戒礼”***,***者可以在特定环境下只通过嗅探监听就可以还原采用RC4保护的加密信息中的纯文本,导致账户、密码、信用卡信息等重要敏感信息暴露,并且可以通过中间人(Man-in-the-middle)进行会话劫持。 ***方法和模式 ***者嗅探监听大量的SSL链接,可以判断第一个加密消息包含SSL的完成消息和HTTP请求,都是具有可预测的信息的。然后等待一个不变性弱密钥的链接到来,当获取到一个弱密钥链接时候就可以提取出LBS。当弱密钥使用的时候,明文和密钥会进行异或,***者可以看到生成的密文模式。 ***者同样也进行DNS投毒,将所有的链接链接到一个恶意的主机,主机进行中间人***,能够有效地进行大量用户的嗅探监听和会话劫持。

本地创建公私钥,实现服务器免密登录

醉酒当歌 提交于 2020-01-21 22:01:58
第一步 ssh-keygen -t rsa -f ~/.ssh/id_rsa 输入服务器登录密码 第二步 ssh-copy-id -i ~/.ssh/id_rsa.pub -p 8022 zhangsan@10.81.126.118 此时使用 ssh luban@10.81.126.118 -p 8022 命令登录,会如下提示,要求输入私钥 Enter passphrase for key ‘~/.ssh/id_rsa’: 第三步 将私钥添加到钥匙串中,按照提示输入私钥密码 ssh-add -K ~/.ssh/id_rsa 第四步 新建config文件,配置config文件,实现免密快速登录 vim ~/.ssh/config 添加 Host zs User zhangsna Hostname 10.81.126.118 Port 8022 PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa UseKeychain yes AddKeysToAgent yes 第五步 ssh zs 直接登录服务器 scp dir_local zs:dir_remote 跳过端口和密码 来源: CSDN 作者: 哀酱 链接: https://blog.csdn.net/u010821666/article/details

Converting a string private key to PrivateKey type

被刻印的时光 ゝ 提交于 2020-01-21 14:07:29
问题 I am having below RSA private key in string format. String privatekey = -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAqAKCCMKqboM8ywSuNvmf2zuT0e2elxntdEe5msv22jzT89Xa 1Q/V4CeQdZruIw8eTAMa67Dej+3cPdSrjdDnfxcb9L14U9oFPgOyvxVwb+/S8jqm F9o7Gvm85X972C8izh+K4ndpPtztxkZ0g7cu7RqrCCBzw5SUfi3pgIpprdiKlVDP 4lF7CTwzRH+oi+BxwOABEiuKOJtjOXX1WJhV6ukEy8K6Fq/QOyt/7vgxkm8I8HMo SMq2UZNswn5/9SqMWuaTBaQbjZ2f77zaq5X/jOiCThTxFNPjPnzhKhG8ekaqIUpB y9VuICFgdtVQimnlDykrdJWyeOFWPjYl5vehkwIDAQABAoIBAQCN2Ig2ozvHUA/s

Verify SHA1withRSA signature generated in Java (Android) with phpseclib

删除回忆录丶 提交于 2020-01-21 07:18:20
问题 This is what I want to do: Generate a 512 bit RSA keypair in Java/Android Generate a SHA1withRSA signature for some message in Java Send message, signature and public key to PHP (for testing this will be done at the same time) Verify the message in PHP using phpseclib What I got so far: On the Java side: String msg = "Test message"; // generate keypair KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(512); KeyPair keyPair = keyGen.generateKeyPair(); // generate

Verify SHA1withRSA signature generated in Java (Android) with phpseclib

我的梦境 提交于 2020-01-21 07:18:04
问题 This is what I want to do: Generate a 512 bit RSA keypair in Java/Android Generate a SHA1withRSA signature for some message in Java Send message, signature and public key to PHP (for testing this will be done at the same time) Verify the message in PHP using phpseclib What I got so far: On the Java side: String msg = "Test message"; // generate keypair KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); keyGen.initialize(512); KeyPair keyPair = keyGen.generateKeyPair(); // generate