Установка PGP на Android
PGP (Pretty Good Privacy / «Достаточно надежная конфиденциальность») — это программа шифрования с публичным ключом, которая стала самым популярным стандартом для шифрования электронных писем . Фраза «Достаточно надежная» – это ироничное преуменьшение.
Помимо шифрования и дешифрования электронной почты, PGP используется для подписи сообщений, чтобы получатель мог верифицировать как личность отправителя, так и целостность содержимого.
PGP использует приватный ключ, который должен храниться в секрете, и публичный ключ, который известен отправителю и получателю.
GPG (GNU Privacy Guard) является независимой реализацией стандартов OpenPGP.
Переходим в Google Play и устанавливаем приложение OpenKeychain: Easy PGP
Шаг первый.
Запустите OpenKeychain и нажмите на кнопку "Создать ключ"
Укажите имя, далее eMail ( данные рекомендуем записать)
Шаг первый.
Шаг второй.
Ставим галочку "Опубликовать на серверах ключей" и справа снизу нажимайте "Создать ключ"
Перейдите вовнутрь созданного вами ключа и нажмите кнопку "Скопировать"
Шаг второй.
Шаг третий.
Авторизуйтесь в свой профиль на сайте ///MEGA и перейдите в личный кабинет.
Скопированный текст вставьте в поле PGP-ключ, поставьте галочку напротив 2FA, нажмите сохранить.
После этого выходите из аккаунта.
Заново авторизуйтесь в своем аккаунте и скопируйте текс из поля "Расшифруйте сообщение"
Шаг третий.
Шаг четвертый.
Откройте OpenKeychain, через боковое меню перейдите на страницу "Зашифровать/Расшифровать"
На этой странице нажмите "Прочитать из буфера"
После чего ваше сообщение будет расшифровано.
Скопируйте получившейся ключ и вставьте в окно "Код" на странице авторизации.
OpenKeychain — достойная реализация OpenPGP на Android

Здравствуйте друзья! Сегодня мы в очередной раз затронем вопрос шифрования и защищенной переписки на Андроид. В начале поговорим о различных реализациях PGP-шифрования. О плюсах и минусах данной криптосистемы.
После чего поговорим о приложении OpenKeychain. В этой инструкции я расскажу откуда скачать, как правильно настроить и работать с данным приложением.
OpenKeychain или PGP на Android
- Предисловие
- Шифрование PGP
- Приложение OpenKeychain
- Возможности
- Скачивание и установка
- Настройка и использование
Шифрование PGP
Первое, что обычно приходит на ум при упоминании зашифрованной переписки, — это PGP. Однако далеко не все реализации этой популярной криптосистемы с открытым ключом в равной степени безопасны.
Различные методы ослабления криптостойкости официально использовались США для экспортных продуктов, а неофициально — и для всех массовых. Компания Symantec, купившая у Филиппа Циммермана права на PGP и закрывшая исходный код своих продуктов, просто обязана соблюдать действующие ограничения американского законодательства и следовать негласным «рекомендациям» своего правительства.
Поэтому сторонники приватности долгое время считали заслуживающими доверия лишь авторские версии PGP 2.x, которые использовали для шифрования сессионных ключей алгоритм RSA или IDEA. Однако после того как в 2010 году методом решета числового поля удалось за приемлемое время вычислить ключ RSA длиной 768 бит, их надежность тоже перестала считаться достаточно высокой.
Внимание современных хактивистов и прочих правозащитников переключилось на свободные реализации PGP с открытым исходным кодом. Большинство из них позволяет выбирать из нескольких алгоритмов и генерировать более длинные ключи. Однако и здесь не все так просто. Более длинный ключ еще не гарантирует большей криптостойкости системы. Для этого в ней должны отсутствовать другие недостатки, а все биты ключа быть в равной степени случайными. На практике это часто оказывается не так.
Битовую последовательность ключа всегда формирует какой-то известный генератор псевдослучайных чисел. Обычно это предустановленный в ОС или взятый из готовых библиотек ГПСЧ. Его случайное или преднамеренное ослабление — самая часто встречающаяся проблема. Некогда популярный Dual_EC_DRBG (использовавшийся и в большинстве продуктов компании RSA) непосредственно был разработан в АНБ и содержал закладку. Выяснили это спустя семь лет, уже когда Dual_EC_DRBG использовался повсеместно.
Приложение OpenKeychain
Все реализации PGP, соответствующие стандарту OpenPGP (RFC 2440 и RFC 4880), сохраняют базовую совместимость друг с другом. На смартфонах с ОС Android добавить шифрование PGP к почте можно, например, с помощью приложения OpenKeychain.
OpenKeychain имеет открытый исходный код, проверенный компанией Cure53 на безопасность, прозрачно интегрируется с почтовым клиентом K-9 Mail, Jabber-клиентом Conversations и даже может передавать зашифрованные файлы в приложение EDS (Encrypted Data Store).
Возможности OpenKeychain
OpenKeychain помогает общаться более конфиденциально и безопасно. Он использует высококачественное современное шифрование. Ваши сообщения могут быть прочитаны только теми людьми, которым вы их отправите.
Другие люди тоже могут посылать вам сообщения, и только вы можете их прочитать; эти сообщения подписываются цифровой подписью, чтобы их получатель был уверен в личности отправителя.
Современное шифрование на основе цифровых ключей. OpenKeychain хранит ключи и управляет ими, привязывая ключи к тем людям из списка контактов, с которыми вы общаетесь. Также она поможет вам найти ключи других людей в Интернете, и обменяться ключами просто коснувшись устройствами (QR коды). Но наиболее частое применение — использование этих ключей для шифрования и расшифровки сообщений.
Скачать OpenKeychain
Установить бесплатно OpenKeychain вы можете с Google Play. Также можете скачать APK с F-Droid и самостоятельно установить.
Настройка OpenKeychain
После того как установили приложение запустим его нажав по иконке приложения на рабочем столе.
ШАГ 1. Первым делом необходимо создать ключи, для этого выбираем пункт «Создать свой ключ».
ШАГ 2. После чего вводим имя и нажимаем «Далее»

Создание ключа
ШАГ 3. Вводим адрес электронной почты. Можно добавить несколько адресов.
ШАГ 4. Вводим пароль. Рекомендуется использовать сложный пароль. Читайте статью «Как создать надежный пароль«.

Создание ключа
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Porvil / PGP-Tool Public
PGP Tool for Android
License
Porvil/PGP-Tool
Name already in use
- Local
- Codespaces
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more about the CLI.
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
PGP (Pretty Good Privacy) for Android
What is PGP?
Pretty Good Privacy (PGP) is an encryption system used for both sending encrypted emails and encrypting sensitive files.
What is PGP for Android?
This application encrypts files using PGP protocol for secure transmission of files between two people.
Installation:
- Download the «PGP-Tool.apk» from here.
- Install the APK.
Usage:
- Give Read/Write Permissions.
The Receiver and Sender Key should be of same size and same set of keys must be used for encryption and decryption.
Sender (Encrypt File):
- Generate Key
- Go to «View Keys» page, and send public key of the key which is generated in step 1 and send it to Reciever.
- Ask Reciever to send his/her public key.
- Go to «Add Other’s Keys» page, and browse and select reciever’s key.
- Go to «Encrypt File» page.
- Select file to encrypt.
- Select your key (Sender’s key) and enter key’s password.
- Select other’s key (Reciever’s key).
- Enter filename to save the encrypted file.
- Press «Encrypt».
The encrypted file would be saved in «internal storage/PGP Tool/Encrypted/filename.pgpdata«.
You can send the encrypted file by using any file manager by going to «internal storage/PGP Tool/Encrypted/filename.pgpdata«.
Reciever (Decrypt File):
- Generate Key
- Go to «View Keys» page, and send public key of the key which is generated in step 1 to sender.
- Ask Sender to send his/her public key.
- Go to «Add Other’s Keys» page, and browse and select sender’s key.
- Go to «Decrypt File» page.
- Select file to decrypt.
- Select your key (Reciever’s key) and enter key’s password.
- Select other’s key (Sender’s key).
- Press «Decrypt».
The decrypted file would be saved in «internal storage/PGP Tool/Decrypted/originalfilename.extension«
Generating Key:
- Select Key Size (available sizes — 1024, 2048, 4096)
- Enter Key Owner name.
- Enter Key Name.
- Enter Password.
Key will be generated using the above details in «internal storage/PGP Tool/My Keys/keyname.key«
You can send public key by going to «View Keys» page by selecting the key you want to send. You can also change the password of your keys by again going to «View Keys» page.
Algorithms Used:
- AES with CBC and PKCS5Padding (For encrypting data)
- RSA with ECB and PKCS1Padding (For encrypting AES session Key)
- SHA1 with RSA (For Digital Signature)
- PBKDF2 with HmacSHA1 (For Hash used in password for private keys)
Supported Android Versions:
- Android 5.0 (API Level-21) and above.
Directories Documentation:
- PGP Directory — «internal storage/PGP Tool/»
- My Keys Directory — «internal storage/PGP Tool/My Keys/»
- Others Keys Directory — «internal storage/PGP Tool/Others Keys/»
- Encrypted Files Directory — «internal storage/PGP Tool/Encrypted/»
- Decrypted Files Directory — «internal storage/PGP Tool/Decrypted/»
This project is tested on the latest android devices with great accuracy
Mentions:
-
for his/her answer on https://stackoverflow.com/questions/13209494/how-to-get-the-full-file-path-from-uri/60642994#answer-60642994
- «FilesUtilsMine.java» is taken from the above link.
License:
Copyright (c) 2020 Porvil
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the «Software»), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Encrypt Text or File Using OpenKeychain/PGP (Android)
I am using PGP for personal text or file encryption, not for communication with another party via email or messaging app.
Why use PGP? Why not AES? I like that PGP have existing apps on various platform (Android, Windows, Linux, etc.) with standardize implementation (I can be sure encryption using App A on Platform B can be decrypted using App C on Platform D).
Create Key
Click CREATE MY KEY . (access via Manage my keys from tripple-horizontal-dot)
- name: since I am not using for communication with another party, specify a purpose or function as the name (e.g. test ). I would recommend lowercase and no case if you plan to use the same key on PC as well.
- email: email if required, though you can specify invalid email like test . To avoid warning and inconvinience, I would use email like [email protected] .
- Publish on keyservers: not necessary as I am not using it for communication with another party
Click CREATE KEY
For added security, you can assign password to your key.
- Select test key.
- Click Change Password (access from tripple-horizontal-dot)
Encrypt
Select test key.
The first icon is encrypt files.
The second icon is encrypt text.
In the encrypt screen
- Lock icon: which is the encryption key to be used.
- Sign icon: identify of the sender (the party who encrypt this). Since we are not using this for communication with another party, sign is optional.
Use the share icons to share the encrypted files to another apps (maybe DropBox or WhatsApp). You can also save to local device (fro files) or copy to clipboard (for text).
- Select files from another App and click Share, then select Encrypt with OpenKeychain .
- You can select/highlight text from any App, then click share and select Encrypt or Encrypt with OpenKeychain .
Decrypt
There is a few ways to decrypt.
- Click on triple-horizontal-lines and select Encrypt/Decrypt . You can import files and copy from clipboard.
- Select files from another App and click Share: If the filename ends with .asc or .pgp , there should be a Descrypt with OpenKeychain .
- You can select/highlight text from any App, then click share and select Descrypt with OpenKeychain .
References:
❤️ Is this article helpful?
Buy me a coffee ☕ or support my work via PayPal to keep this space and ad-free.
Do send some to @d_luaz or share this article.
A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz
Travelopy — discover travel places in Malaysia, Singapore, Taiwan, Japan.