Source language: Translate to:

Variable calculates.....

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Variable calculates.....

Postby ebear » Sun Jun 01, 2014 8:44 am

Hello All,

I have a small question, but a good answer can make my weekend good :wink:

I use a combination of the npReg and npCiph plugins from the http://neoplugins.com of David Esperalta, and want to write the license key generated with npReg, as an Encripted row in a license file.
The problem is now that for example the key 7290-D9F9-8290-3358-7505-9786-E9D7 is written as only 7290. I understand this because NeoBook thinks this is a calculation.

I know about for example SetVar "[Text]" "!1+1" where the ! prevents the calculation.

But how do I prevent the calculation in the code below???

npCiphEncryptStr "[CipherID]" "haSHA512" "[licenses.lic_owners.Owner_LicKey]" "password" "[EncLicKey]"
FileWrite "[PubDir]licenses\[licenses.lic_owners.Owner_Name]\license.lic" "9" "[EncLicKey]"

Thanks a lot for your support,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Variable calculates.....

Postby Gaev » Sun Jun 01, 2014 9:56 am

Eric:

Try ...
Code: Select all
npCiphEncryptStr "[CipherID]" "haSHA512" "![licenses.lic_owners.Owner_LicKey]" "password" "[EncLicKey]"
FileWrite "![PubDir]licenses\[licenses.lic_owners.Owner_Name]\license.lic" "9" "![EncLicKey]"

I am not familiar with the npCiph plugin ... so I do not know what [CipherID] is ... you may have to place a ! in front of this variable as well.

Hope it ...
can make my weekend good
... what is left of it.
User avatar
Gaev
 
Posts: 3733
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 10:18 am

Hello,

Thanks Gaev for the try. Eric, I am not sure, but may you found a bug in the cipher string action npCiph plugin. I am investigating and try to fix this as quickly as possible. Sorry for the inconveniences. :(
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby ebear » Sun Jun 01, 2014 10:42 am

Hello Gaev and David,

David I think it is a small bug, I'm pretty familiar with the way Neobook works with variables but I was already from yesterday fighting with this and without a solution.
Hopefully you will find the the problem, otherwise the both plugins are working excellent.

Thanks both for your support.

Regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 10:53 am

Hello,

Well. Here is what I found at now. The file encryption action works like we can expected. It's the string encryption who apparently do not work like we can expected for larger strings (not too much larger). Apparently the problem is the way in which the strings are managed/stored.

The bad part? I am test the cipher (same code) in Delphi and everything works fine. But also here, if I try to shown (in a MessageBox) the encrypted text, I can view this is too short for the string I am encrypted. For some reason the MessageBox text appear "chunked". And this is the real problem.

If we have a "chunked" encrypted string, our decrypted string cannot match with the original text: necesarily is short. However, in Delphi, I can decipher such text (no matter what MessageBox shown me) but for some reason in NeoBook we get the encrypted text chunked, like in the MessageBox...

And for this reason the decrypt string action cannot do their work: what we provide as encrypted text is just a chunked part of them, so the resulted string never can match with the original one. Well. I really do not know at this time how I can achieve this, but continue investigating a possible solution.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 11:08 am

Hello,

Bellow is a proof of concept about what I say in my previous message:

http://www.neoplugins.com/Temp/Sample.zip

Maybe you are interested in view what I want to say with your own eyes.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby ebear » Sun Jun 01, 2014 11:28 am

Hi David,

I see it.... Please don't mess up the left over of the weekend only for me... It's not that important... :P

Thanks very very very much for your efforts as always...

Regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 11:34 am

Hello,

Don't worry Eric.This really sock me, since I test my works before publish, but, for some reason I only test the encrypt/decrypt string actions with (not intentionally) "short" strings. Taking a look here at the Delphi debugger the issue appear transparent: the variable which store the encrypted text contain the appropiate encrypted text, not chunked, and for this reason we can decrypt this encrypted text without problems.

But, for some reason, I can't get working that encrypted text shown in a MessageBox, saved in a file, copied to the Clipboard, etc. What I get is a chunked part of the encrypted text, which of course cannot be decrypted propertly. Well. I will continue to searching for a possible solution for this problem.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 2:48 pm

Hello,

Well. Probably the cause of the problem can be some characters which an encrypted text can contain. In the same way we can't shown this kind of characters in a "Memo" or a "MessageBox", apparently, these characters are loss when the plugin pass the encrypted text to the appropiate NeoBook variable. The proposed solution (for example, here) is to encode the encrypted text into "base 64". However, I test it this afternoon without good results. But tomorrow I plain to test it again with this approach more slowly (maybe I commit some mistake), since I already try other several things and no one offers good results. Also I ask for help to my Delphi colegues (in spanish), and one suggest me the refered solution... maybe another one can provide me with other possible way.

This is what I can say at this time.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Sun Jun 01, 2014 4:02 pm

Hello,

Well. Let me to share the latest news. I installed Delphi in my laptop... just to test if encoding the encrypted text in "base 64" can help or not. Certainly I make some mistake last afternoon, because this approach apparently works like we can expected. However I cannot test it in the plugin right now, but, I can, for example, shown in a "Memo" or a "MessageBox" the "base 64" encoded encrypted text and then decrypt it from there. So I expect we can pass the "base 64" encoded text to NeoBook without loss any data and finally offer a solution to this issue as quickly as possible.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Mon Jun 02, 2014 1:57 pm

Hello,

I continue testing here...
Last edited by dec on Mon Jun 02, 2014 5:05 pm, edited 1 time in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby ebear » Mon Jun 02, 2014 2:56 pm

Hello David,

I hope that everything is okay with your mother, and please don't spent too much time in this problem as family issue's are the first to deal with.

I found for the moment the solution in encrypting the whole file and I'm fine with it, Wrangler gave me a tip how to do it. Although I know it's not really 100%, but I can live with it.
As you already wrote before, it is impossible to secure an application for 100%.

Please let me know if I can help you with testing or something else.

Best regards,

Eric
http://www.lunarsoftware.eu - Lunar Software ERP database Development. Manufacturing processes, Document management, QMS, Stock management. Standalone solutions or connected to Helios Orange and other ERP systems.
User avatar
ebear
 
Posts: 270
Joined: Wed Jan 18, 2012 3:12 am
Location: Vrchlabi - Czech republic

Re: Variable calculates.....

Postby dec » Mon Jun 02, 2014 3:11 pm

Hello,

Thanks for your interest Eric. Everything is fine here: we visited the hospital a lot from the latest two years, tomorrow, for example, we need to come it again. But apparently the evolution is normal and good. I disagree with you Eric, this problem is unaceptable. My first fault is to try to store binary data into a text string. Simply unaceptable.

Thanks again Eric. I will continue searching for a solution and inform to you and here about any progress.
Last edited by dec on Mon Jun 02, 2014 5:07 pm, edited 1 time in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Mon Jun 02, 2014 3:17 pm

Hello,

I continue testing here...
Last edited by dec on Mon Jun 02, 2014 5:07 pm, edited 1 time in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Re: Variable calculates.....

Postby dec » Mon Jun 02, 2014 3:44 pm

Hello,

More confusion to the soup... testing npUtil plugin here in Windows 7... apparently we can encode larger strings to "base 64" (without absurd 60.000 chars limitation) and then decode it also without problems. Certainly I note yesterday some "rare" differences between Windows 7 and Windows 8, which cause I use another component to encode/decode strings. Another absurd, because "base 64" do not change between computers, then something absolutely crazy (to me) occur here...

Well. I want to continue investigating! :wink:
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Next

Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest