# How to hide part of the source passwords etc

**URL:** <https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458>\
**Category:** Ruby\
**Created:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458 "2006-09-04T14:44:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 4, 2006, 2:44pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/1 "2006-09-04T14:44:06Z")

</div>

I do some stuff that encapsulate calls to various systems  
(os api, erp queries, databases access) and if the results  
are no secret some passwords used internally are. How to  
solve the issue?

example: one program to create a Windows AD user  
and use internally higher credentials…(runas…)

You may ask how is it protected now?  
Certainly not perfectly but it is in the compiled versions  
and kids under 3 will not set a breakpoint.

regards

DD

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/2 "2006-09-05T17:51:33Z")

</div>

If you create a windows user based on datas stored in a  
flat file and do all the checking to have it done  
consistently. You can give the program to a  
non administrator of the network. But you will not give  
the administrator password so that any task be done  
by anyone.

regards

Didier

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/3 "2006-09-05T17:51:32Z")

</div>

Didier wrote:

> I do some stuff that encapsulate calls to various systems  
> (os api, erp queries, databases access) and if the results  
> are no secret some passwords used internally are. How to  
> solve the issue?

Have the user of the program enter a password, rather than include the  
password in the program itself.

I reply in this way because it is an obvious solution, but you haven’t  
explained your situation very clearly.

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 5, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/4 "2006-09-05T17:51:33Z")

</div>

Didier wrote:

> If you create a windows user based on datas stored in a  
> flat file and do all the checking to have it done  
> consistently. You can give the program to a  
> non administrator of the network. But you will not give  
> the administrator password so that any task be done  
> by anyone.

It is difficult to understand the goal as you have explained it. As I  
understand it, you want to grant administrative rights to  
non-administrative users, but you don’t want them to have administrative  
authority.

You really cannot grant administrative access without going through the  
access procedure, which includes a password. The password is either in  
the  
script, or it is known to the user so he can type it in. Neither of  
these  
options seems particularly attractive.

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 5, 2006, 10:46pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/5 "2006-09-05T22:46:32Z")

</div>

Well If i want to let users do say runas something it must  
be done in client server or xml rpc or whatever the flavor.

a huge drawback for Ruby (and Python).

regards.

Didier

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 6, 2006, 4:00am UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/6 "2006-09-06T04:00:59Z")

</div>

Didier wrote:

> Well If i want to let users do say runas something it must  
> be done in client server or xml rpc or whatever the flavor.

How about ruby2scriptexe?

> a huge drawback for Ruby (and Python).

Java isn’t much safer in this regard. It’s fairly straight forward to  
decompile byte code to the original.

---

<div class="post-metadata">

**Author:** ![Didier](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@Didier](https://www.ruby-forum.com/u/Didier)\
**Post date:** [September 6, 2006, 6:48pm UTC](https://www.ruby-forum.com/t/how-to-hide-part-of-the-source-passwords-etc/67458/7 "2006-09-06T18:48:33Z")

</div>

On 9/5/06, Cliff C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Java isn’t much safer in this regard. It’s fairly straight forward to  
> decompile byte code to the original.

And compiled C code or the like isn’t necessarily that safe either.

On Unix\> man strings  
on Windows:  
[http://www.sysinternals.com/Utilities/Strings.html](http://www.sysinternals.com/Utilities/Strings.html)

One shouldn’t rely that much on security by obscurity.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
