rodhoward / node-sybase

23 stars 55 forks source link

Password Encryption #5

Open zebra0mussel opened 7 years ago

zebra0mussel commented 7 years ago

Hi,

I am trying to connect to a SYBASE ASE 15.7 database which is configured to require password encryption. Is there any way that this feature could be added?

Using password encryption

Thanks!

George

rodhoward commented 7 years ago

Hi George,

As of version 1.0.12 I have added support for a "sybaseConfig.properties" file where you can add jconnect properties that will be added to the connection. I have no way to test that encryption is working so it would be great if you could post back and let me know if that solved your problem.

It looks like you would put in the "sybaseConfig.properties" file something like:

ENCRYPT_PASSWORD=true
JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Taken from http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1500/html/newfesd/newfesd95.htm

Cheers Rod

zebra0mussel commented 7 years ago

Thanks, Rod! I'm a little tied up with other things today, but will take a look some time this week.

On Jan 8, 2017 10:54 PM, "Rod Howard" notifications@github.com wrote:

Hi George,

As of version 1.0.12 I have added support for a "sybaseConfig.properties" file where you can add jconnect properties that will be added to the connection. I have no way to test that encryption is working so it would be great if you could post back and let me know if that solved your problem.

It looks like you would put in the "sybaseConfig.properties" file something like:

ENCRYPT_PASSWORD=true JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Taken from http://infocenter.sybase.com/help/index.jsp?topic=/com.sybas e.infocenter.dc20155.1500/html/newfesd/newfesd95.htm

Cheers Rod

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rodhoward/node-sybase/issues/5#issuecomment-271207432, or mute the thread https://github.com/notifications/unsubscribe-auth/AXU6iwC-7o2vZXx3eD_eAhP1GuGt2rPJks5rQa-BgaJpZM4LICv_ .

zebra0mussel commented 7 years ago

Hi Rod,

I downloaded the new library and created a sybaseConfig.properties file (containing the one encryption property) and placed it in the same directory where I ran node mySybaseTest.js, but I got a Null Pointer Exception. Should I be placing that file elsewhere? Any other thoughts?

Thanks,

George

On Jan 9, 2017 10:09 AM, "George Chaly" zebra0mussel@gmail.com wrote:

Thanks, Rod! I'm a little tied up with other things today, but will take a look some time this week.

On Jan 8, 2017 10:54 PM, "Rod Howard" notifications@github.com wrote:

Hi George,

As of version 1.0.12 I have added support for a "sybaseConfig.properties" file where you can add jconnect properties that will be added to the connection. I have no way to test that encryption is working so it would be great if you could post back and let me know if that solved your problem.

It looks like you would put in the "sybaseConfig.properties" file something like:

ENCRYPT_PASSWORD=true JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Taken from http://infocenter.sybase.com/help/index.jsp?topic=/com.sybas e.infocenter.dc20155.1500/html/newfesd/newfesd95.htm

Cheers Rod

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rodhoward/node-sybase/issues/5#issuecomment-271207432, or mute the thread https://github.com/notifications/unsubscribe-auth/AXU6iwC-7o2vZXx3eD_eAhP1GuGt2rPJks5rQa-BgaJpZM4LICv_ .

rodhoward commented 7 years ago

Hi George

I think your putting it in the right place (same directory your running node from). I got the same exception, I think you need to point the jconnect library to another jar file that does the encryption configured in the same config file.

If you have any java code that connects to the server already I would copy that it should be easy to drop it in and recompile the java bridge. Having said that it sounded like it should just work with the right config and possibly another java library.

Cheers Rod

On 14 Jan. 2017 11:58 am, "zebra0mussel" notifications@github.com wrote:

Hi Rod,

I downloaded the new library and created a sybaseConfig.properties file (containing the one encryption property) and placed it in the same directory where I ran node mySybaseTest.js, but I got a Null Pointer Exception. Should I be placing that file elsewhere? Any other thoughts?

Thanks,

George

On Jan 9, 2017 10:09 AM, "George Chaly" zebra0mussel@gmail.com wrote:

Thanks, Rod! I'm a little tied up with other things today, but will take a look some time this week.

On Jan 8, 2017 10:54 PM, "Rod Howard" notifications@github.com wrote:

Hi George,

As of version 1.0.12 I have added support for a "sybaseConfig.properties" file where you can add jconnect properties that will be added to the connection. I have no way to test that encryption is working so it would be great if you could post back and let me know if that solved your problem.

It looks like you would put in the "sybaseConfig.properties" file something like:

ENCRYPT_PASSWORD=true JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Taken from http://infocenter.sybase.com/help/index.jsp?topic=/com.sybas e.infocenter.dc20155.1500/html/newfesd/newfesd95.htm

Cheers Rod

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/rodhoward/node-sybase/issues/5#issuecomment-271207432 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXU6iwC-7o2vZXx3eD_ eAhP1GuGt2rPJks5rQa-BgaJpZM4LICv_ .

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/rodhoward/node-sybase/issues/5#issuecomment-272587385, or mute the thread https://github.com/notifications/unsubscribe-auth/AF_kCes6CKFgjvJPV5kvX-uZzQN66cnGks5rSB27gaJpZM4LICv_ .

zebra0mussel commented 7 years ago

Hi Rod,

Ah yes, that rings a bell. I recently set up DB Visualizer (a db management tool) on my machine with SYBASE password encryption by following these instructions:

https://support.dbvis.com/support/solutions/articles/1000231934-how-to-enable-password-encryption

Basically, I had to configure DB Visualizer to use jconn4.jar and a crypto API (bcprov-jdk15on-155.jar) both of which I had to download. Configuration involved setting these two properties:

ENCRYPT_PASSWORD=true JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

I can try setting the JCE_PROVIDER_CLASS property as above using jconn3.jar, but I recall a colleague recently telling me that password encryption for SYBASE ASE wasn't possible using that version of JConnect and that he had to use jconn4.jar. I'll try it later today, but if that doesn't work, I may have to explore using jconn4.jar

Thanks,

George

On Sat, Jan 14, 2017 at 12:28 AM, Rod Howard notifications@github.com wrote:

Hi George

I think your putting it in the right place (same directory your running node from). I got the same exception, I think you need to point the jconnect library to another jar file that does the encryption configured in the same config file.

If you have any java code that connects to the server already I would copy that it should be easy to drop it in and recompile the java bridge. Having said that it sounded like it should just work with the right config and possibly another java library.

Cheers Rod

On 14 Jan. 2017 11:58 am, "zebra0mussel" notifications@github.com wrote:

Hi Rod,

I downloaded the new library and created a sybaseConfig.properties file (containing the one encryption property) and placed it in the same directory where I ran node mySybaseTest.js, but I got a Null Pointer Exception. Should I be placing that file elsewhere? Any other thoughts?

Thanks,

George

On Jan 9, 2017 10:09 AM, "George Chaly" zebra0mussel@gmail.com wrote:

Thanks, Rod! I'm a little tied up with other things today, but will take a look some time this week.

On Jan 8, 2017 10:54 PM, "Rod Howard" notifications@github.com wrote:

Hi George,

As of version 1.0.12 I have added support for a "sybaseConfig.properties" file where you can add jconnect properties that will be added to the connection. I have no way to test that encryption is working so it would be great if you could post back and let me know if that solved your problem.

It looks like you would put in the "sybaseConfig.properties" file something like:

ENCRYPT_PASSWORD=true JCE_PROVIDER_CLASS=org.bouncycastle.jce.provider.BouncyCastleProvider

Taken from http://infocenter.sybase.com/help/index.jsp?topic=/com.sybas e.infocenter.dc20155.1500/html/newfesd/newfesd95.htm

Cheers Rod

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/rodhoward/node-sybase/issues/5# issuecomment-271207432 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXU6iwC-7o2vZXx3eD_ eAhP1GuGt2rPJks5rQa-BgaJpZM4LICv_ .

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub <https://github.com/rodhoward/node-sybase/issues/5#issuecomment-272587385

, or mute the thread https://github.com/notifications/unsubscribe-auth/AF_kCes6CKFgjvJPV5kvX- uZzQN66cnGks5rSB27gaJpZM4LICv_ .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rodhoward/node-sybase/issues/5#issuecomment-272603375, or mute the thread https://github.com/notifications/unsubscribe-auth/AXU6i_U8gornaHKWMkQFuxpYJ-J-zH2vks5rSFz0gaJpZM4LICv_ .

sreedatta commented 6 years ago

Hi George, Rod,

Did you get any solution on this. i want to connect to sybase ASE 15.7. i am not able to connect. i was not able to find JavaSybaseLink.jar file, which support jconn4.

could you please help me.

Thanks & Regards, Sree

sreedatta commented 6 years ago

Can someone, please help me on this. its urgent for me.

Thanks Sree

martvaha commented 6 years ago

Did you try setting the JavaSybaseLink.jar path manually?

javaJarPath = './JavaSybaseLink/dist/JavaSybaseLink.jar',
db = new Sybase('host', port, 'dbName', 'username', 'pw', logTiming, javaJarPath);

make sure javaJarPath points to the actual jar file