Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Behind the Scenes
  3. Wiki Discussion
  4. New SimpleCrypt page
Forum Updated to NodeBB v4.3 + New Features

New SimpleCrypt page

Scheduled Pinned Locked Moved Wiki Discussion
98 Posts 26 Posters 95.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    butterfingerss
    wrote on last edited by
    #87

    Hey there, I am new to Qt and just came across your work ... great work by the way... could you tell me where your updated work might be? like the latest one?

    cuz I seem to have a problem with this one - https://www.gitorious.org/qtdevnet-wiki-mvc/qtdevnet-simplecryptiodevide/source/a170750960820be4230ea1aff85148fc41f0dcf3:

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vrushali_deshpande
      wrote on last edited by
      #88

      Hi Andre,

      Thanks for the code. It is really useful.

      But is there any way to find out whether the file is encrypted or not? I would like to know if the input file is encrypted or not, if yes, then only I will decrypt it.

      Thanks in advance,
      Vrushali

      1 Reply Last reply
      0
      • K Offline
        K Offline
        Kaluss
        wrote on last edited by
        #89

        Hi Andre,
        an example how to check it You got directly in the code:

        @
        if (version !=3) { //we only work with version 3
        m_lastError = ErrorUnknownVersion;
        qWarning() << "Invalid version or not a cyphertext.";
        return QByteArray();
        }
        @

        But is very useful thing that if You send to decryp function non-encypted data it will return the same string.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kaluss
          wrote on last edited by
          #90

          Hi Andre,
          an example how to check it You got directly in the code:

          @
          if (version !=3) { //we only work with version 3
          m_lastError = ErrorUnknownVersion;
          qWarning() << "Invalid version or not a cyphertext.";
          return QByteArray();
          }
          @

          But is very useful thing that if You send to decryp function non-encypted data it will return the same string.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #91

            I disagree. I don't think the class should return the cyphertext as the plaintext if the cyphertext could not be decrypted. I think that it is the responsibility of the application to keep the conceptually very different plaintext and cypher text separate. If you don't know if a text is a cyphertext or a plaintext, I think you have design issues.

            If you really want, you can work around this yourself by simply checking the returned string and the last error, and then using the original plain text on decryption error. I wouldn't recommend that though.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #92

              I disagree. I don't think the class should return the cyphertext as the plaintext if the cyphertext could not be decrypted. I think that it is the responsibility of the application to keep the conceptually very different plaintext and cypher text separate. If you don't know if a text is a cyphertext or a plaintext, I think you have design issues.

              If you really want, you can work around this yourself by simply checking the returned string and the last error, and then using the original plain text on decryption error. I wouldn't recommend that though.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                Kaluss
                wrote on last edited by
                #93

                I could have this situation only when im switching between debug/release mode, because I decidated not to enrypt files when Im working on debug mode, thus when I go back to release all my files are not encrypted. At the moment I check result, and if its empty I put the orginal string.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  Kaluss
                  wrote on last edited by
                  #94

                  I could have this situation only when im switching between debug/release mode, because I decidated not to enrypt files when Im working on debug mode, thus when I go back to release all my files are not encrypted. At the moment I check result, and if its empty I put the orginal string.

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    Kaluss
                    wrote on last edited by
                    #95

                    One more question to the author I changed all calls of depraced from and to ASCII to Latin1 not to Utf8. It's ok with that?

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      Kaluss
                      wrote on last edited by
                      #96

                      One more question to the author I changed all calls of depraced from and to ASCII to Latin1 not to Utf8. It's ok with that?

                      1 Reply Last reply
                      0
                      • J Offline
                        J Offline
                        Julianoliveira
                        wrote on last edited by
                        #97

                        I had the same problem, and substitute:

                        toAScii -> toLatin1
                        fromAScii -> fromASCII

                        Works fine to me too,

                        Thanks for sharing the code.

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          Julianoliveira
                          wrote on last edited by
                          #98

                          I had the same problem, and substitute:

                          toAScii -> toLatin1
                          fromAScii -> fromASCII

                          Works fine to me too,

                          Thanks for sharing the code.

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved