1

Topic: Advise a method of enciphering of the text

As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. It is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. Quite would approach RSA, truth I do not know that it.

2

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. S> it is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. S> Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. For enciphering and decoding I would use libraries (program) which audit by someone is already made, for example openssl: https://stackoverflow.com/questions/160 … rypt-files

3

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. S> it is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. S> Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. S> quite would approach RSA, truth I do not know that it. Several months ago, I studied operation GPG (https://www.gnupg.org). Quite approaches for the task. If it is necessary to integrate into the program library GPGME is offered: https://www.gnupg.org/software/gpgme/index.html https://www.gnupg.org/documentation/manuals/gpgme/

4

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> It is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. Here, symmetric, on a simple key - goes for countryside

5

Re: Advise a method of enciphering of the text

Hello, RonWilson, you wrote: Here than always irritated similar libraries so it is a heap of functions which the user (developer) the nobility does not want. Well why that is impossible what interfaces ? Always it is necessary for the finite user only such:... CString strText (_T ("My very confidential data.")); CString strEncodedText = superlib:: Encode (strText);... ALL! I here do not want to see initialization any there, contexts and other entrails! When  will be such? As in any way the 21st century.

6

Re: Advise a method of enciphering of the text

Hello, Dead Down, you wrote: > When  will be such? As in any way the 21st century. Please: file: mysuperencryption.c void encrypt (char * str) {while (*string) *string ++ ^ = 81;} void decrypt (char * str) {while (*string) *string ++ ^ = 81;}

7

Re: Advise a method of enciphering of the text

Hello, Dead Down, you wrote: > Here than always irritated similar libraries so it is a heap of functions which the user (developer) the nobility does not want. Well why that is impossible what interfaces ? Can be because the cryptography is at all so simply how it seems? Even for the minimum usage it is necessary to understand a difference between are asymmetric and  circuits, block and stream enciphering, including modes for block encryption. > always it is necessary for the Finite user only such: > >... > CString strText (_T ("My very confidential data." )); > CString strEncodedText = superlib:: Encode (strText); >... > > ALL! I here do not want to see initialization any there, contexts and other entrails! > When  will be such? As in any way the 21st century. Is enough  old libraries Crypto ++ and Botan which approximately it and give to the user (with corrections that the user all the same should have minimum representations about cryptography). Here an example from the documentation to Botan: #include <botan/rng.h> #include <botan/auto_rng.h> #include <botan/cipher_mode.h> #include <botan/hex.h> #include <iostream> int main () {Botan:: AutoSeeded_RNG rng; const std:: string plaintext ("Your great-grandfather gave this watch to your granddad for good luck. Unfortunately, Dane's luck was not as good as his old man's." ); const std:: vector <uint8_t> key = Botan:: hex_decode ("2B7E151628AED2A6ABF7158809CF4F3C"); std:: unique_ptr <Botan:: Cipher_Mode> enc (Botan:: get_cipher_mode ("AES-128/CBC/PKCS7", Botan:: ENCRYPTION)); enc-> set_key (key); Botan:: secure_vector <uint8_t> pt (plaintext.data (), plaintext.data () +plaintext.length ());//generate fresh nonce (IV) enc-> start (rng.random_vec (enc-> default_nonce_length ())); enc-> finish (pt); std:: cout <<enc-> name () <<"with iv" <<Botan:: hex_encode (iv) <<"" <<Botan:: hex_encode (pt) <<"\n"; return 0;} not too strongly differs that you want.

8

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. Cryptography not that area where it is possible to write on a knee encryption algorithm implementation - too many subtleties, therefore we take that those already wrote who in a subject, for example, openssl. But, at once I will tell that  it will be that still . I wrote  a wrapper heder-onli, can look: https://github.com/mtrempoltsev/opensslpp usage Example it is possible to look in tests, here for example: auto aes = opensslpp:: Aes256:: createNewKey (); ASSERT_NE (aes, nullptr); const std:: string plainText = "1234567890abcdef-+=!qwerty0987654321ABCDEF"; std:: vector <uint8_t> cipher; opensslpp:: Aes256:: Iv iv; ASSERT_TRUE (aes-> encrypt (plainText, cipher, iv)); std:: vector <uint8_t> plainData; ASSERT_TRUE (aes-> decrypt (cipher, iv, plainData)); ASSERT_EQ (plainText, std:: : string (reinterpret_cast <char *> (plainData.data(), plainData.size ())); the Short educational program. There are 2 types of enciphering - symmetric and asymmetric. Symmetric much faster, the key for enciphering and decryption is used one. An algorithm example - AES. Dissymetric slow and to it it is impossible to cipher much, therefore cipher actually the symmetric algorithm, and asymmetric cipher only symmetric key. An algorithm example - RSA. Still this algorithm can be used for the sign-code signature. In asymmetric enciphering it is used two keys - opened and closed. To transfer opened it is possible easy, closed it is necessary to keep secret. Ciphered by public key it is decrypted only by the closed. It means that you can give the public key to everybody, ciphered by it you can read only. In turn you can cipher the private key and any having public key will be assured that you ciphered.

9

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. S> it is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. S> Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. S> quite would approach RSA, truth I do not know that it. Greetings It is necessary the nobility at qualitative level and to distinguish all main concepts of cryptography. Well, i.e. without understanding of the main modern concepts be not put at all not only in bowels of algorithms, but also to interfaces of libraries. Otherwise your work, very possibly, will not cost the eaten away egg since the competent expert finds an error in the receptions used by you and at one stroke crosses imaginary protection. It concerns illiterate usage  reliable and widespread tools. Further, about low-level libraries (by experience) openssl, libressl - at once is not present. Yet you do not know, for what it is required to you, it is not necessary. , it is not necessary to use as a default. botan - library of algorithms. All is, if know that it is necessary for you - take and use. libsodium - here that is necessary for you. Certainly, always it is necessary to read the documentation. Also consider, the documentation on cryptography has property to become outdated, i.e. articles and recommendations 00 should be considered years very much critically, especially concerns quantitative informations and a level of reliability of those or other algorithms. But, we address to an initial message. What task? Perhaps it is necessary to use more high-level decisions? For example, gnupg - a tooling of command line for enciphering, signatures and everything that is connected to enciphering of files and messages. Quite probably to cause it from your program. Than not a variant?

10

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. libsodium. Examples from the documentation more than are evident and simple (as well as library).

11

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> It is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. Enciphering is precisely necessary, instead of simply to hide from outside eyes? Therefore as banal XOR it is excellent with it consults, on F3 anything intelligible will not be.

12

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> It is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. Archive this data. And on F3 will not open, and slightly places you will save up.

13

Re: Advise a method of enciphering of the text

Hello, Submitter, you wrote: S> As I am very far from this subject, eyes run up looking at various libraries and methods of enciphering of the text. S> it is necessary to save the text data a disk, but it would not be desirable in the pure state (that any interested person could look at them pushing F3), it would be desirable not so difficult (but it is possible also difficult) the encryption algorithm and an application example to it. S> Can give the reference to such source code where at first on an input the text which is encoded is given, and then it is decoded reversely. S> quite would approach RSA, truth I do not know that it. Idle time  under win it CryptProtectData, CryptUnprotectData