RSA encryption and
Hello
I'm trying to implement encryption RSA BB10 and. Currently I have a poor visibility of the BB implementations of them. This link provides an example of one-way encryption (which I am not after) and this discussion provides an example that uses the openssl library.
I prefer to use the BB10 or is it better to use openssl? There are some examples that I can follow? Or please tell me the proper documentation.
Thank you
It is the starting point,
http://developer.BlackBerry.com/native/reference/BB10/com.QNX.doc.crypto/topic/c_sb_overview.html
There is an example of code here...
Note: Looking at your previous posts it seems you just ask your question and then leave it at that. If you want to encourage others to help in your problems then please get used to using the "as - thumbs up" next to the post office and closing your job offers by accepting one of the answers as the solution.
Tags: BlackBerry Developers
Similar Questions
-
RSA encrypt in C++ Blackberry10
Hello. I'm new with Blackberry10 and I need to encrypt a password with the RSA. I searched in the blackberry developers website and I found the hursa.h API security. I have experience working with Blackberry in Java and I know that in Java, the first thing to do once got you the Module and the public exponent is to create the object of RSA publick key, e.g. RSAPublicKey publicKey = new RSAPublicKey (new RSACryptoSystem (2048), ebytes, Mo); I am trying to perform this exact task in the new platform BB10 with C++ and I failed.
I've seen several methods in the page, but none of them are complete, like a hu_RSAKeySet(), I think I should use. I tried to use it, but I know I'm missing something, I don't know if I should create an object of this class of hursa or something like that. For now I'm just including hursa in my class and try to implement the method and the message I get is "undefined reference to"hu_RSAKeySet '"Any help will be appreciated. Not at all. As I said I am not a guru in the RSA encryption of the process, but I made this ecrypting in the old Blackberry java platform and it wasn't that hard.
Thank you all and consider better.
Solved. After doing some research and getting to know better with BB10 and RSA encoding, I've finally came out with the solution to successfully encrypt a plain text with RSA and Base64 in C/C++ for BB10 or any other platform. Please take into consideration that I have the module and the public object rsa exponent since I'm working with services.
Code:
QByteArray answer; RSA* rsa = RSA_new(); BIGNUM *modulus = BN_new(); BIGNUM *exponent = BN_new(); constchar*modulusString = rsaObj->getM();//My Modulus constchar*exponentString = rsaObj->getE();//My exponent BN_hex2bn(&modulus, modulusString); BN_hex2bn(&exponent, exponentString); rsa->n = BN_new(); BN_copy(rsa->n, modulus); rsa->e = BN_new(); BN_copy(rsa->e, exponent); int maxSize = RSA_size(rsa); qDebug()<<"maxSize:"<< maxSize; constchar*inn ="1234"; unsignedchar*encrypted =(unsignedchar*) malloc(maxSize); int bufferSize = RSA_public_encrypt(strlen(inn),(unsignedchar*) inn, encrypted, rsa, RSA_PKCS1_PADDING); if(bufferSize ==-1){ RSA_free(rsa); qDebug()<<"Error"; } QByteArray enc =QByteArray::fromRawData((constchar*) encrypted,256); answer = enc.toBase64(); return answer;
Thank you and I hope this helps for new developers BB10
-
Hi guys,.
I use code below for RSA encryption. Always out.size () gives the value 0. but it's not throw an exception. Where is the problem? Please help me.
module of the private channel = "2CmNWUxYnaX5A5musNu8D6mOsYlnguGV1m + CGp4pKHMM2KV0izVOUjDHnhNbWUOLQfSMId5bXkmIqYPTKZ2KqZ16GNt65ygUjJxfZlFmOMGicTADkaHciPP8ZIxQmBdtta0pqeRP5AD + FG y144BzfNWCAXkPlo7Vwph2dMvb8E plus";
Exhibitor private string = "Collaboration."
Private String data = "Welcome to Cryptography."Private byte [] RSAencrypt (byte [] data) throws IOException, NoSuchAlgorithmException, CryptoException
{Cryptosystem of RSACryptoSystem = new RSACryptoSystem (1024);
Expo of Byte [] = null;
Byte [] modul = null;Try
{
Expo = Base64InputStream.decode (Exhibitor, 0, exponent.length ());
Modul = Base64InputStream.encode (module a, 0, modulus.length ());
catch (IOException ioe)
{
}If (expo == null | modul == null)
Returns a null value.RSAPublicKey publicKey = new RSAPublicKey (cryptosystem, expo, modul);
NoCopyByteArrayOutputStream out = new NoCopyByteArrayOutputStream();
Engine RSAEncryptorEngine = new RSAEncryptorEngine (publicKey);
PKCS1FormatterEngine fengine = new PKCS1FormatterEngine (engine);
CryptoStream BlockEncryptor = new BlockEncryptor (fengine, out);cryptoStream.write (data, 0, data.length);
int finalLength = out.size ();
Byte [] cipherText = new ubyte [finalLength];System.arraycopy (encrypted text, out.getByteArray (), 0, 0, finalLength);
String txt = new String (cipherText);
} catch (Exception ex) {}
System.out.println ("EncryptString:" + ex.toString ());
}Thanks in advance,
I found the solution. Need to close the two cryptoStream and out as below
cryptoStream.write (data, 0, data.length);
cryptoStream.close ();
out. Close();
Thank you
-
Universal Clipboard is encrypted and how the data is stored in iCloud
Hello
You need a deep understanding of the works of the new, universal Clipboard feature safety? The feature is nice, but do you copy your password by company store system administrator password... This password is moving all over the world and also through Apple servers... Don't make me happy.
Who can guarantee that the communication is encrypted and the data stored in iCloud are not used for other purpose?
Thanks and greetings
Security and privacy - Apple Support Overview iCloud
Although not listed here, all data transmitted to the Apple servers is encrypted in transit and on the server.
I can't offer any advice on the question of whether your transmissions could be intercepted and decoded.
They say they also unequivocally that they never provide encryption keys to any third party. Which has been further strengthened with their recent dealings with the FBI.
You'll have to decide for yourself if you agree with what Apple says.
-
Encrypted and signed e-mail are not displayed correctly
Hello
I managed to install a certificate from encryption of electronic mail on my Mac running OS X 10.11.4 but when I get an encrypted email and I open it in Mail it does not display security status, so there is no way of knowing that it is actually an encrypted email. Enamel appears encrypted and signed icon on my iPhone and iPad with the installed certificates. What configuration change I'm supposed to do to make this work/display correctly on Mac.
If I delete the certificates then I get an e-mail with the attachment smile.p7m.
I tried a bunch of different searches on the internet without a little luck to find how to fix.
Thank you!
Duane
S/MIME support seems to be broken in the current version of mail. I don't know of a workaround and I don't know when it will be fixed.
-
15 - r036tu: pci encryption and decryption hp 15-r038tu
Dear Sir
I parchase a new laptop model number is 15-r036tu I got this laptop with window 8.1 after using a few months I failed to ease with the 8.1 that I HAVE LOW grade of 8.1 for Windows 7 (32 bit) now my all software are missing, but I can downlode my software all except pci encryption and decryption I try this software downlode by going to computer management and make a right click, but fails to update driver please give me any advice or links to how software downlode.Thank you
Og2Hello:
You need the driver for this device...
Intel driver execution of the trust Interface Version: -
Encrypt and decrypt the algorithm for visual basic 6
I would like to know a code complex algorithm in Visual Basic 6 to encrypt and decrypt ini files to encrypt credentials
Kindly help.
Hello
I suggest you to ask your question in the below link:
-
processing order of encryption and ACLs
Hi people,
I am preparing to a test lab and have the following scenario:
R6---172.16.50/24---PIX---172.16.10/24--R1
R6 I have two interfaces:
lo0 6.6.6.6/24
FA0/1 172.16.50.50/24
R1 two int:
lo0 1.1.1.1/24
E0 172.16.10.1/24
I want to protect all traffic between the 6.6.6.0 and network 1.1.1.0 with IPSec. I use ESP to protect traffic.
Another condition is that I want to put an ACL to e0 allowing IPSec traffic.
I created an ACL named ACL_E0_IN that is applied on e0 for inbound traffic.
R1 #sh of access lists
Expand the IP ACL_E0_IN access list
esp permits 172.16.50.50 host 172.16.10.1 (15 matches)
permit udp host 172.16.50.50 host 172.16.10.1 eq isakmp (116 matches)
refuse the log host 1.1.1.1 icmp host 6.6.6.6 (5 matches)
Ping of R6 R1 does not work:
R6 #p 1.1.1.1 source lo 0
Type to abort escape sequence.
Send 5, echoes ICMP 100 bytes of 1.1.1.1, time-out is 2 seconds:
Packet sent with the address source 6.6.6.6
.....
Success rate is 0% (0/5)
R6 #.
On the R1, I get the following message:
* 8 Mar 03:58:37.917: % s-6-IPACCESSLOGDP: ACL_E0_IN denied icmp 6.6.6.6 - list
> 1.1.1.1 (8/0), 4 packs
This scenario works ONLY when I allow ICMP of R6 and ESP traffic.
I wonder why the decrypted packets are denied by the ACL. I expect that the ACL is processed BEFORE the packet is decrypted. When I look at the meter on the hit of the ACL, it seems that the ACL is checked twice.
Someone at - it an idea on the exact order of encryption and the treatment of the ACL?
Thank you
Michael
Attached you will find the configs of the R1 and R6
Michael
I recently saw an explanation of encryption and ACLs that indicates there has recently been a change in behavior. In most versions of IOS, the behavior is as you describe, the package is evaluated by the ACL twice. The explanation is that the package is evaluated first in his State encrypted to check that it was something that must be dealt with. After the package has been decrypted, the IOS necessary to assess the package decrypted to see if things like the quality of Service necessary to apply. So basically the decrypted packet passed through the interface again and the ACL again. In recent versions of the code (12.3 (4) T, if memory serves) a change has been made and the package will now go through the ACL only once.
HTH
Rick
-
Hello
I am trying to encrypt and protect my SQLite database. To do this, I have generated a pair of public/private key using the administration Blackberry signature tool. Then, I added the .key file to my project and written the code for encryption and data protection. Then, I signed the app with Blackberry signing authority tool such as mentioned in the documentation. It was duly signed. But my application does not work on the device. It shows that my application tries to access a secure API which means that it is not properly signed.
What could be the problem?
And also I want to know what is the difference between the signing of the "Tool of signed" app within the eclipse and sign the application with "Blackberry signing authority tool '?
I sign my application with eclipse itself "tool of signed" before adding the public .key file and it worked very well.
Please suggest.
Thank you.
You must sign with both.
-
Packet encryption and decryption by IPSEC Tunnel
Hello world
You must confirm if Site A has VPN IPSEC to Site B through Public network.
PCs on site say a package is sent in clear text to the switch, then switch sends to the VPN router.
Router VPN to site A will make encryption and send over a WAN link encrypted.
When the packet reaches a router B Site it will decrypt the packet and send clear text to PC right of the site B?
Thank you
MAhesh
Hello Manu,
Yes, you are right.
Encryption and decryption will perform VPN closing devices.
Best regards
Eugene
-
Packages that do not receive encryption and decrypt IPSEC
Hello world
I have 2691 conencted to the Internet router and it does NAT.
This connects to the 3550A shift that has the connection to the router 1811W.
I have VPN installation between 1811W and 3550.
3550 has connection to 2691 via ospf.
OSPF is running between 1811w and 3550.
1811
1811w # sh crypto isakmp his
IPv4 Crypto ISAKMP Security Association
DST CBC conn-State id
192.168.99.2 192.168.99.1 QM_IDLE 2005 ASSETS
IPv6 Crypto ISAKMP Security Association
1811w # sh crypto ipsec his
Interface: FastEthernet0
Tag crypto map: VPN_MAP, local addr 192.168.99.1
protégé of the vrf: (none)
local ident (addr, mask, prot, port): (192.168.0.0/255.255.0.0/0/0)
Remote ident (addr, mask, prot, port): (192.168.99.0/255.255.255.0/0/0)
current_peer 192.168.99.2 port 500
LICENCE, flags is {origin_is_acl},
#pkts program: encrypt 0, #pkts: 0, #pkts digest: 0
#pkts decaps: 0, #pkts decrypt: 0, #pkts check: 0
compressed #pkts: 0, unzipped #pkts: 0
#pkts uncompressed: 0, #pkts compr. has failed: 0
#pkts not unpacked: 0, #pkts decompress failed: 0
#send 30, #recv errors 0
local crypto endpt. : 192.168.99.1, remote Start crypto. : 192.168.99.2
Path mtu 1500, mtu 1500 ip, ip mtu IDB FastEthernet0
current outbound SPI: 0x0 (0)
PFS (Y/N): N, Diffie-Hellman group: no
SAS of the esp on arrival:
the arrival ah sas:
SAS of the CFP on arrival:
outgoing esp sas:
outgoing ah sas:
outgoing CFP sas:
3550A
3550SMIA # sh crypto isakmp his
IPv4 Crypto ISAKMP Security Association
status of DST CBC State conn-id slot
192.168.99.2 192.168.99.1 QM_IDLE 1001 ACTIVE
IPv6 Crypto ISAKMP Security Association
3550SMIA #sh cry
3550SMIA #sh crypto ipsec his
Interface: FastEthernet0/8
Tag crypto map: VPN_MAP, local addr 192.168.99.2
protégé of the vrf: (none)
local ident (addr, mask, prot, port): (192.168.0.0/255.255.0.0/0/0)
Remote ident (addr, mask, prot, port): (192.168.99.0/255.255.255.0/0/0)
current_peer 192.168.99.1 port 500
LICENCE, flags is {origin_is_acl},
#pkts program: encrypt 0, #pkts: 0, #pkts digest: 0
#pkts decaps: 0, #pkts decrypt: 0, #pkts check: 0
compressed #pkts: 0, unzipped #pkts: 0
#pkts uncompressed: 0, #pkts compr. has failed: 0
#pkts not unpacked: 0, #pkts decompress failed: 0
#send 15, #recv errors 0
local crypto endpt. : 192.168.99.2, remote Start crypto. : 192.168.99.1
Path mtu 1500, ip mtu 1500
current outbound SPI: 0x0 (0)
SAS of the esp on arrival:
the arrival ah sas:
SAS of the CFP on arrival:
outgoing esp sas:
As we have seen more top packets are not encrypted between 1811w and 3550.
I used the same ACLs on 1811W and 3550A
INTERESTING_TRAFFIC extended IP access list
IP 192.168.0.0 allow 0.0.255.255 192.168.99.0 0.0.0.255 connect
Reasons why packages do not encrypt and decrypt?
Thank you
MAhesh
Hello
Access-list for interesting traffic should be mirrored.
Best regards
Eugene
-
Encrypt and decrypt using the key of the table
Dear Experts,
Here is my package to encrypt and decrypt with triples in oracle 11 g.
In my package, I used encryption_key (3FECCDC7D348A85B096F0B43C4C6A38DBBD369DB37FEA435) according to this key we are encryption and decryption.
My requirement is now, I don't want to spend the encryption_key in my code.we key stored in a table (key_details) and using the key column, we her encrypt and decrypt the data.
-----------------------------------
create the table key_details
(
Identification number,
VARCHAR2 (48) key
);
insert into key_details values(1,'3FECCDC7D348A85B096F0B43C4C6A38DBBD369DB37FEA435');
-------------------------------------
CREATE or REPLACE PACKAGE encr_decr
AS
FUNCTION encrypt (p_plainText VARCHAR2) RETURN RAW DETERMINISTIC;
FUNCTION decrypt (p_encryptedText RAW) RETURN VARCHAR2 DETERMINISTIC;
END;
/
CREATE or REPLACE PACKAGE encr_decr BODY
AS
encryption_type PLS_INTEGER: = DBMS_CRYPTO. ENCRYPT_3DES
+ DBMS_CRYPTO. CHAIN_ECB
+ DBMS_CRYPTO. PAD_PKCS5;
encryption_key RAW (48): = UTL_RAW.cast_to_raw ('3FECCDC7D348A85B096F0B43C4C6A38DBBD369DB37FEA435');
FUNCTION encrypt (p_plainText VARCHAR2) RETURN RAW DETERMINISTIC
IS
encrypted_raw RAW (2000);
BEGIN
encrypted_raw: = DBMS_CRYPTO. ENCRYPT
(
SRC = > UTL_RAW. CAST_TO_RAW (p_plainText),
Typ = > encryption_type,.
key = > encryption_key
);
RETURN encrypted_raw;
END encrypt;
FUNCTION decrypt (p_encryptedText RAW) RETURN VARCHAR2 DETERMINISTIC
IS
decrypted_raw RAW (2000);
BEGIN
decrypted_raw: = DBMS_CRYPTO. DECRYPT
(
SRC = > p_encryptedText,
Typ = > encryption_type,.
key = > encryption_key
);
RETURN (UTL_RAW. CAST_TO_VARCHAR2 (decrypted_raw));
END decrypt;
END;
/
Help, please.
create or replace package body encr_decr
as
encryption_type pls_integer: = dbms_crypto.encrypt_3des
+ dbms_crypto.chain_ecb
+ dbms_crypto.pad_pkcs5;
gross encryption_key (48);
--
function encrypt (p_plaintext varchar2)
gross return deterministic
is
Start
Return dbms_crypto.encrypt (CBC-online utl_i18n.string_to_raw (p_plaintext)
typ-online encryption_type
key-online encryption_key
);
end encrypt;
--
function decrypt (gross p_encryptedtext) return varchar2 deterministic
is
Start
Return utl_i18n.raw_to_char (dbms_crypto.decrypt (src-online p_encryptedtext
typ-online encryption_type
key-online encryption_key
)
);
put an end to decrypt;
Start
Select the key in encryption_key
of key_details
where id = 1;
end;
/
-
Is it possible to create a standard form which can be sent by email to anyone and once filled by the receiver, have a button that clicks on the receiver and the form is encrypted and attached to an e-mail to the sender and a built-in admin password it open?
Hello Graphicsguy123,
You can get the workflow above using the Widget feature. Here is the link for reference:
https://helpx.Adobe.com/document-cloud/help/create-widgets.html -Usman
-
PGP Whole Disk Encryption and Boot Camp Partition
I use the PGP 10.0 Beta for the last two weeks (it is now been shipped and is the current version), and one of the new features is Whole Disk Encryption on Boot Camp partitions. It works fine - except for the fact that VMWare Fusion 3.0.1 can not load the Boot Camp partition is encrypted (it starts initially, but does not advance beyond what I suppose is the PGP bootloader).
I know that I can create a virtual machine and run Windows to work around the problem - I'm just curious to know if this is something that VMWare are willing to study and operate now PGP 10.0 has been shipped.
It seems to be fixed/supported in a future version?
Thank you very much .
This looked interesting so I tried myself. I downloaded a demo of PGP 10.0 and encrypted to my hard drive which has OS X 10.5.8 and a Windows 7 Boot Camp partition.
After starting the machine virtual Boot Camp in Fusion, I see a black screen that says bootguard _
I guess that's also what you see?
You're right - it's the PGP bootloader which replaced the Windows loader in the MBR of the physical disk. Fusion accesses the data in the partition through Mac OS X, which already has access to the decrypted data. The boot loader assumes that the drive is always encrypted and fails when he tries to decrypt again.
Fortunately, Boot Camp VMs include a copy of the MBR (with the boot code and the partition table) in a separate file, so it's very easy to fix:
#. Start the machine virtual of Boot Camp (not native!) with a Windows CD/DVD installation (or ISO image).
#. Go to the repair command prompt.
#. Run the fixmbr command in Windows XP or bootrec /fixmbr in Windows Vista or Windows 7 to replace the MBR code.
In this way, your Boot Camp virtual machine will use the default Windows boot loader to access the already decrypted data, while the native Boot Camp startup will use code PGP MBR (which is always the physical disk) to access the prompt for the PGP password and decrypt the drive.
-
ENCRYPTION and DECRYPTION of a FILE BLOB
Hello
How to encrypt and decrypt a file blob. Can U please give me an example to encrypt a file BLOB?
Thank youUse the DBMS_CRYPTO package...
http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_crypto.htm#ARPLS664
Maybe you are looking for
-
How to connect Iphone to Satellite A200 as modem
Hello So I was hitting my head on the wall, trying to figure out why I can't tie my Iphone 3 g to my laptop (Yes, I update 3.0). My phone says internet tethering is enabled and even my laptop recognize the phone as a modem, and I see a connection to
-
Failure of compilation of the FPGA target
Hi all I met a problem when I tried to compile my target FPGA VI. Failed to compile for some reason any to halfway after start of the compilation. I post a few screen shots of the labview error information. What causes this problem? How could I solve
-
I have the wireless option, but if I use it not I can't connect to the internet.
I have the wireless option, but if I use it not I can't connect to the internet. original title: difficulty borrowed from internet
-
problem with the speed of usb 3.0
IM using pavilion tx windows g6 2016 8.1 pro,. When I'm using windows 7 I used to get about 38 Mbps speed, but after installing windows 8.1 it usually exceeding 32MBps... but once I had 70 Mbit/s for a video avi file... only for this video... Here is
-
Automatic download agreed to explore 9 but my unisites to murdoch.com.au done, nt it how to I Explorer 7 back