forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencrypt-using-rsa.lcdoc
More file actions
72 lines (49 loc) · 2.14 KB
/
Copy pathencrypt-using-rsa.lcdoc
File metadata and controls
72 lines (49 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
Name: encrypt using rsa
Type: command
Syntax: encrypt <message> using rsa with {public | private} key <key> [and passphrase <passphrase>]
Summary:
Encrypt data using the RSA algorithm.
Introduced: 4.6
OS: mac, windows, linux, ios, android
Platforms: desktop, server, mobile
Security: network
Example:
encrypt myMessage using rsa with public key myKey
Example:
encrypt thisMessage using rsa with private key privateKey
Parameters:
key:
The key to be used for the encryption, in PEM format
passphrase:
An optional passphrase
message:
The message to be encrypted
Description:
Use the <encrypt using rsa> command to encrypt a message using RSA
public key encryption.
To encode a message that you only want to be decoded by the holder of
the private key, use the form:
encrypt <message> with public key <key>
As a signing operation, to encode a message that a receiver can then verify
has come from one of the holders of the private key, use the form:
encrypt <message> with private key <key>
#### Generating key pairs
Public-private key pairs can be generated using the OpenSSL suite of
command-line tools. For example: openssl genrsa -out private_key.pem 512
openssl rsa -pubout -in private_key.pem -out public_key.pem
Will generate a key pair of size 512-bits, placing the private key in
private_key.pem and the public key in public_key.pem.
For more information on these utilities see
https://www.openssl.org/docs/manmaster/man1/rsa.html and
https://www.openssl.org/docs/manmaster/man1/genrsa.html.
>*Note:* The maximum length of a message that can be encrypted using
> RSA is the size of the key in bytes -11. So, for a 512-bit key pair,
> the maximum encryptable message size is 53 bytes.
For signing, the maximum length of an encryptable message isn't really
an issue since typically in that scenario it will be some sort of hash
that would be being encrypted. For the more traditional encrypting
scenario, however, the standard approach is to use public key
cryptography to encrypt a random password which is then used with a
symmetric cipher to actually encrypt the payload.
References: decrypt (command), encrypt (command),
decrypt using rsa (command)