×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    easy cryptage of a string / array of strings

    Hi,

    I would like to show some strings or array of strings in a control; but I have noticed that some hacker modified the string of an application !! therefore, which would be the best way to easily encrypt/decrypt those strings (or array) to avoid the edition with an hexa editor ? easily means without a strong algorithm to avoid comsumption of time !

    Thanks in advance,
    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: easy cryptage of a string / array of strings

    You may want to search for encrypt in the Wiki.
    However if your strings have been modified using a hexa editor, you probably mean your resource file or some other data file - in that case you could rather store some hash/checksum of the complete file, and simply check it on application startup. With this approach you would not have to deal with decryption in runtime, but your file would be still protected against modification.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: easy cryptage of a string / array of strings

    Hi wizard_hu_ ,

    thanks for this fast reply, I don't want to use resource file; I want to bind the strings directly into the code (as static); the .rss files can be easily modified ! but I want that my strings (in the code) are encrypted to avoid to see them when browsing the binary file with an edition (text or binary); the de-cryption could appear when the strings are needed (at the fly).

    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: easy cryptage of a string / array of strings

    Basically you could make your own logic on mangling the strings, or use real encryption, and base64 the result and then store it as a string, thus everytime you read the string, you decode the Base 64 first,and then decrypt it..

  5. #5
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: easy cryptage of a string / array of strings

    Hi symbianyucca,

    yeps, that's an idea; because the strings must be encoded in the code !!; I have checked at the wiki, there is no way to start from an encoded string to decode them; but how to store the encoded strings into the code ? maybe in hexa whith an hexa generator ...

    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: easy cryptage of a string / array of strings

    Even if you have your strings in your code, it is still possible to feed all of them to a hash algorithm on startup, and check the result against a pre-calculated one. Basically you do not want to keep your strings as secret, you just want to protect them against modification. These are two different use cases in cryptograpy.

  7. #7
    Super Contributor
    Join Date
    Jun 2005
    Location
    Berlin
    Posts
    721

    Re: easy cryptage of a string / array of strings

    another easy way to encrypt/decrypt is using OpenC libcrypt.lib:

    encrypt() function encrypts and decrypts 64-bit messages. The algorithm used to perform encryption/decryption is Data Encryption Standard (DES).

    or there should be open souce blowfish...
    Symbian && Android && iPhoneOS

  8. #8
    Registered User
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    730

    Re: easy cryptage of a string / array of strings

    I don't use openC.

    but, meanwhile, I have re-written the encode/decode fct based on base64 method to avoid to use the "build-in" lib functions and to have my own, and it's easy to put the encoded texts into strings (as it's not binary) !!

    Btw, thanks everybody for the replies,
    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

Similar Threads

  1. C++ 學習程序2
    By hanwen813 in forum [Archived] Other Programming Discussion 关于其他编程技术的讨论
    Replies: 32
    Last Post: 2009-04-02, 09:10
  2. Strings and Files
    By maniac_2k in forum Symbian
    Replies: 6
    Last Post: 2006-11-28, 16:01
  3. Replies: 5
    Last Post: 2006-02-26, 17:29
  4. a question about the user agent string
    By jackchang1@gmail.com in forum Mobile Java General
    Replies: 3
    Last Post: 2005-09-19, 12:06
  5. Personal
    By JSmith77 in forum PersonalJava
    Replies: 4
    Last Post: 2003-07-30, 12:52

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×