Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RSA跨平台b/w JAVA和;塞班_Java_Encryption_Rsa_Symbian - Fatal编程技术网

RSA跨平台b/w JAVA和;塞班

RSA跨平台b/w JAVA和;塞班,java,encryption,rsa,symbian,Java,Encryption,Rsa,Symbian,1) 我能够用我的应用程序生成的值在symbian中用以下值进行加密和解密 RInteger iE = RInteger::NewL(0x10001); RInteger iN = RInteger::NewL(_L8("\xa3\x92\xb7\x34\x82\xbe\x7f\x4f\x8f\xbd\xfb\xd4\xf9\x80\x76\xe0\xa3\xf7\x42\x60\x8e\xe2\xa8\x6b\x76\x22\x6

1) 我能够用我的应用程序生成的值在symbian中用以下值进行加密和解密

          RInteger iE = RInteger::NewL(0x10001);            
          RInteger iN = RInteger::NewL(_L8("\xa3\x92\xb7\x34\x82\xbe\x7f\x4f\x8f\xbd\xfb\xd4\xf9\x80\x76\xe0\xa3\xf7\x42\x60\x8e\xe2\xa8\x6b\x76\x22\x67\x0e\x94\xeb\x9b\x3f\xd0\x73\x58\xe0\x23\xbb\x25\x53\x82\x56\x7b\x3e\x05\x57\xc9\x50\x3c\x2d\x6a\x09\x66\x3f\x49\xee\x41\x4c\x4b\x95\x1e\x7d\xb8\xd1\xc5\x40\x0d\xd0\xca\x72\xc8\xf6\x0d\x21\x4f\x63\xc1\x4c\x3b\x93\x94\x1f\x67\x5b\x70\x33\x07\xfd\x4e\x71\x59\x7f\x79\x9b\xd8\xf6\x3b\x35\xe1\x9a\xd3\x27\x43\xdb\x32\xcd\x7b\x78\x40\xd1\x0d\x40\x12\x53\xb7\x19\x66\xca\x5b\xf6\x26\x2a\xea\x4e\xef\xe4\xc8\x41"));
          RInteger iD = RInteger::NewL(_L8("\x44\x21\x5a\xff\x9b\x29\x7f\x5b\x83\x32\x8d\x8f\x02\xb1\x18\x52\xae\xd8\xd1\x23\xe8\xbf\xcd\x88\x9c\xf6\xed\x57\xec\x7d\x49\xf7\xc5\x7a\x15\xdd\x9d\xe4\x58\x42\xb5\x3a\x12\x31\x1e\x06\x97\x8a\x3c\xd6\x69\xa1\x2a\x9e\x57\xcb\xce\x14\xda\x32\x6d\x35\xce\x61\x9e\xb2\xaf\x5c\x04\x13\xef\x68\x43\x7e\xe4\x98\xdc\x87\x2e\x7e\x38\x5f\xbd\xe9\x2e\xc1\xf1\x94\xf3\x95\x56\x56\xa4\x78\x26\x70\xa4\x1e\x10\x61\xe9\x45\x25\x1c\xed\xc6\xc0\x1e\xf6\x2c\xa0\x27\xee\x19\x0a\xed\x1c\x76\x33\xc8\x37\xde\x76\x25\x1c\x70\x77\xb1"));
2) 从服务器接收N、E和D值,然后生成公钥和私钥。 (a) 在应用程序中使用公钥加密,并在服务器端成功解密。 但是 (b) 无法使用我的应用程序中的私钥进行解密。正在添加。 (c) 即使服务器加密的消息无法在应用程序中解密,也会出现相同的错误

代码:

RInteger iE=RInteger::NewL(0x10001);
RInteger iN=RInteger::NewL(_L8("\XX8 9\X0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\x89\xfd\x3f\x80\xe0\xff\x8d\x16\xc2\xe9\xf5\x6e\xd3\xab\x17\x79\x53\xd5\x4c\x9c\x30\x35\x7d\x04\xe6\x77\xce\xdd\x99\x12\x90\x6e\xf8\xa0\x46\xd7\xb0\x18\x5b\x7f\x20\x22\xa8\xe4\x35\xb0\xc6\xec\xae\xf9\x3f\x08\x9f\xc3\xaa\x36\x77\x55\x5b\x5d\x84\x20\x46\xc7”);
RInteger iD=RInteger::NewL(_L8(“\x5\x7 1\x0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 10 10 10 10 10 0 0 0 0 0 0 0 0 0 0 0 0 0 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\x3c\xed\xc6\x8a\x02\x58\xb6\x8d\x6d\xf8\x34\x65\x03\xe3\x8a\x15\x37\xdf\x12\X88\x18\xff\xce\xfa\x20\x20\xd6\xb7\x1a\x05\x6f\x2c\x04\x13\x58\x62\x94\xe9\xbc\x63\xc8\xd3\xd6\x06\x61\x44\x3e\xac\xe4\x98\x14\x63\xb1\X07\x06\xaf\x1c\x16\xb6\x5b\x87\x87\x8e\x26\x01”);
TBuf8 aaaa;
TBuf8 aOut;
CRSAPublicKey*iPubKey=CRSAPublicKey::NewL(iN,iE);
CRSAPrivateKey*iPriKey=CRSAPrivateKeyStandard::NewL(iN,iD);
CRSAPKCS15V15Encryptor*IENCER=CRSAPKCS15V15Encryptor::NewL(*iPubKey);
CRSAPKCS15V15Decryptor*iDecry=CRSAPKCS15V15Decryptor::NewL(*iPriKey);
TRAPD(err3,ientr->EncryptL(_L8(“Hi”),aaaa));
TRAPD(err2,iDecry->DecryptL(aaaa,aOut));我该怎么办

TInt len=iEncr->MaxOutputLength();
iEncr->EncryptL(_L8("Hi"),aaaa);
if (aaaa.Length()<len){
    TBuf8<1> t;
    t.SetLength(1);t[0]=0;
    aaaa.Insert(0,t);
}
TInt len=encyr->MaxOutputLength();
EncryptL(_L8(“Hi”),aaaa);

如果(aaaa.Length()没有注释??建议!!??这些函数在“原始”上执行"使用OpenSSL和证书文件进行签名时,密钥涉及一些输入数据的填充,这在Symbian下无法正确实现。此链接可能会给您一些提示:谢谢,但这是关于验证器和签名者的,我知道如何解决添加?有人能帮我吗?您尝试应用
CPaddingPKCS1Encrypti了吗on::PadL
分别对加密前后的明文执行PadL
操作?无法执行pad和UnPad操作如何执行pad和UnPad操作?在RSA加密方法中,只有PKCS15V填充操作,因此除此之外,我还必须分别执行pad和UnPad操作??
TInt len=iEncr->MaxOutputLength();
iEncr->EncryptL(_L8("Hi"),aaaa);
if (aaaa.Length()<len){
    TBuf8<1> t;
    t.SetLength(1);t[0]=0;
    aaaa.Insert(0,t);
}