Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Don't panic.


devel / comp.unix.shell / OpenSSL: Decrypt/Encrypt with same file name

SubjectAuthor
* OpenSSL: Decrypt/Encrypt with same file namegpa...@gmail.com
+- Re: OpenSSL: Decrypt/Encrypt with same file nameKenny McCormack
+- Re: OpenSSL: Decrypt/Encrypt with same file namehymie!
+* Re: OpenSSL: Decrypt/Encrypt with same file nameBen Bacarisse
|`* Re: OpenSSL: Decrypt/Encrypt with same file namegpa...@gmail.com
| `* Re: OpenSSL: Decrypt/Encrypt with same file nameBen Bacarisse
|  `* Re: OpenSSL: Decrypt/Encrypt with same file namegpa...@gmail.com
|   `* Re: OpenSSL: Decrypt/Encrypt with same file nameBen Bacarisse
|    `* Re: OpenSSL: Decrypt/Encrypt with same file namegpa...@gmail.com
|     `- Re: OpenSSL: Decrypt/Encrypt with same file nameBen Bacarisse
`- Re: OpenSSL: Decrypt/Encrypt with same file nameKees Nuyt

1
OpenSSL: Decrypt/Encrypt with same file name

<0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3822&group=comp.unix.shell#3822

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a0c:9e0f:: with SMTP id p15mr13163211qve.33.1621606286899;
Fri, 21 May 2021 07:11:26 -0700 (PDT)
X-Received: by 2002:a05:6214:148a:: with SMTP id bn10mr12932890qvb.40.1621606286546;
Fri, 21 May 2021 07:11:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Fri, 21 May 2021 07:11:26 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=122.171.192.235; posting-account=9j_33QoAAADW1Zm5MU4cyLLhykHRk2Mj
NNTP-Posting-Host: 122.171.192.235
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
Subject: OpenSSL: Decrypt/Encrypt with same file name
From: gpar...@gmail.com (gpa...@gmail.com)
Injection-Date: Fri, 21 May 2021 14:11:26 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gpa...@gmail.com - Fri, 21 May 2021 14:11 UTC

Hi All,

I need to Decrypt/Encrypt a file in the same name, but is this allowed ?

My project script is available in the Encrypted format . I need to perform the the following steps .

1. Decrypt the project file
2. Execute the the project by running the file
3. Encrypt the project file back

openssl enc -aes-256-cbc -pass pass:password -d -p -base64 -in ./run1.sh -out run1.sh
source ./run1.sh
openssl enc -aes-256-cbc -pass pass:password -p -base64 -in ./run1.sh -out ./run1.sh

Please suggest a solution for the above problem.

Thanks
Parth

Re: OpenSSL: Decrypt/Encrypt with same file name

<s88gcv$158a3$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3823&group=comp.unix.shell#3823

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Fri, 21 May 2021 14:34:07 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <s88gcv$158a3$1@news.xmission.com>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
Injection-Date: Fri, 21 May 2021 14:34:07 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="1220931"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Fri, 21 May 2021 14:34 UTC

In article <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>,
gpa...@gmail.com <gparthu@gmail.com> wrote:
>Hi All,
>
>I need to Decrypt/Encrypt a file in the same name, but is this allowed ?
>
>My project script is available in the Encrypted format . I need to perform the
>the following steps .
>
>1. Decrypt the project file
>2. Execute the the project by running the file
>3. Encrypt the project file back

I suppose that, as always, the first question to ask is: Why?
(I.e., what is wrong with using the solution you already have?)

Now, not saying that there aren't good aesthetic reasons for wanting to do
it "in place". In fact, I recently met up with this issue - where I had a
program that doesn't support "editing in place" and I wished that it did.
It is natural to note that some programs (sed, gawk) do support editing in
place, and wouldn't it be nice if they all did.

What I came up with was this, as a general solution:

$ ex -c '%!yourprogram -someOption "Quoted arg to someOption: $opt"' -c x $file

Or, another idea, could you just do:

$ yourDecryptionProgram -o /dev/stdout | sh

(I.e., not write out the decrypted text to a disk file at all)

--
Conservatives want smaller government for the same reason criminals want fewer cops.

Re: OpenSSL: Decrypt/Encrypt with same file name

<slrnsafhdn.910.hymie@nasalinux.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3824&group=comp.unix.shell#3824

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!fdcspool5.netnews.com!fdc2.netnews.com!news-out.netnews.com!news.alt.net!fdc3.netnews.com!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx03.iad.POSTED!not-for-mail
Newsgroups: comp.unix.shell
From: hym...@nasalinux.net (hymie!)
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
Organization: Eric Conspiracy Secret Labs
User-Agent: slrn/pre1.0.4-5 (Linux)
Message-ID: <slrnsafhdn.910.hymie@nasalinux.net>
Lines: 31
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Fri, 21 May 2021 14:37:43 UTC
Date: Fri, 21 May 2021 14:37:43 GMT
X-Received-Bytes: 1800
 by: hymie! - Fri, 21 May 2021 14:37 UTC

In our last episode, the evil Dr. Lacto had captured our hero,
gpa...@gmail.com <gparthu@gmail.com>, who said:
> Hi All,
>
> I need to Decrypt/Encrypt a file in the same name, but is this allowed ?
>
> My project script is available in the Encrypted format . I need to perform the the following steps .
>
> 1. Decrypt the project file
> 2. Execute the the project by running the file
> 3. Encrypt the project file back
>
> openssl enc -aes-256-cbc -pass pass:password -d -p -base64 -in ./run1.sh -out run1.sh
> source ./run1.sh
> openssl enc -aes-256-cbc -pass pass:password -p -base64 -in ./run1.sh -out ./run1.sh

In most cases, you cannot guarantee that this process (using the same file
as both input and output) happens in a regular well-known well-supported
sequence.

Your best bet IMHO would be

openssl enc -aes-256-cbc -pass pass:password -d -p -base64 \
-in ./run1.sh -out run1a.sh
mv run1a.sh run1.sh
source ./run1.sh
openssl enc -aes-256-cbc -pass pass:password -p -base64 \
-in ./run1.sh -out ./run1a.sh
mv run1a.sh run1.sh

--hymie! http://nasalinux.net/~hymie hymie@nasalinux.net

Re: OpenSSL: Decrypt/Encrypt with same file name

<87lf88qg48.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3825&group=comp.unix.shell#3825

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Fri, 21 May 2021 16:08:23 +0100
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <87lf88qg48.fsf@bsb.me.uk>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="4197826e04eaef1955d46cbbdc611355";
logging-data="31676"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198r1/fVCWlVrNvdC31HRfQwdq075Z1V5g="
Cancel-Lock: sha1:/BGLgpILtYCt6SRWa6wm5SAcfVM=
sha1:uJaV8m44m6X4qTeW8kGaocqhee8=
X-BSB-Auth: 1.f47d47c9ed70a21639ee.20210521160823BST.87lf88qg48.fsf@bsb.me.uk
 by: Ben Bacarisse - Fri, 21 May 2021 15:08 UTC

"gpa...@gmail.com" <gparthu@gmail.com> writes:

> I need to Decrypt/Encrypt a file in the same name, but is this allowed?

Why do you need to? I know this the sort of answer people hate to get,
but it's generally a bad idea to try to do this.

> My project script is available in the Encrypted format . I need to
> perform the the following steps .
>
> 1. Decrypt the project file
> 2. Execute the the project by running the file

Technically you don't do this. "Sourcing" the file is not the same as
running it.

> 3. Encrypt the project file back
>
> openssl enc -aes-256-cbc -pass pass:password -d -p -base64 -in ./run1.sh -out run1.sh
> source ./run1.sh
> openssl enc -aes-256-cbc -pass pass:password -p -base64 -in ./run1.sh -out ./run1.sh
>
> Please suggest a solution for the above problem.

I would not store the decrypted file at all:

openssl enc -aes-256-cbc -pass pass:password -base64 -d \
-in ./run1.sh -out - | source /dev/stdin

and unless you really need to source it, I'd pass it to a shell:

openssl enc -aes-256-cbc -pass pass:password -base64 -d \
-in ./run1.sh -out - | sh

To address your original question, you can't use the file for the input
and the output, but you can use the same name provided you move one out
of the way. So move the source, decrypt to the old name and then remove
the source or decrypt to a new name and the rename it. This can lose
you your data unless you check the everything went well.

--
Ben.

Re: OpenSSL: Decrypt/Encrypt with same file name

<rtnfagh4q9i2cuifoioph717rnp6f9hmdi@dim53.demon.nl>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3826&group=comp.unix.shell#3826

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
From: k.n...@nospam.demon.nl (Kees Nuyt)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Fri, 21 May 2021 18:35:46 +0200
Reply-To: k.nuyt@nospam.demon.nl
Message-ID: <rtnfagh4q9i2cuifoioph717rnp6f9hmdi@dim53.demon.nl>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
User-Agent: ForteAgent/7.10.32.1214
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 35
NNTP-Posting-Host: e7ffd774.news.xs4all.nl
X-Trace: G=4gCEEL3Z,C=U2FsdGVkX18QE5NIVPioOgmDl0qHNVIzx5YA50bnnMJYN548hc4BIvUlLwNs8HNj6wpMBmjWG6smznYkN6SDCM3k1zEZjW8HyJhtSaUenhc=
X-Complaints-To: abuse@xs4all.nl
 by: Kees Nuyt - Fri, 21 May 2021 16:35 UTC

On Fri, 21 May 2021 07:11:26 -0700 (PDT), "gpa...@gmail.com"
<gparthu@gmail.com> wrote:

> I need to Decrypt/Encrypt a file in the same name, but is this allowed ?
>
> My project script is available in the Encrypted format . I need to perform the the following steps .
>
> 1. Decrypt the project file
> 2. Execute the the project by running the file
> 3. Encrypt the project file back

> openssl enc -aes-256-cbc -pass pass:password -d -p -base64 -in ./run1.sh -out run1.sh
> source ./run1.sh
> openssl enc -aes-256-cbc -pass pass:password -p -base64 -in ./run1.sh -out ./run1.sh

You are allowed to do anything you like, but it might not work
to youre satisfaction.
If you "need to Decrypt/Encrypt a file in the same name" and the
tools can't do it, you are stuck.

What did you try? What were the results/prblems?

I would suggest something like:

mv -f ./run1.sh ./run1.aes
openssl enc -aes-256-cbc -pass pass:password \
-d -p -base64 -in ./run1.aes -out ./run1.sh
source ./run1.sh
openssl enc -aes-256-cbc -pass pass:password \
-p -base64 -in ./run1.sh -out ./run1.aes
mv -f ./run1.aes ./run1.sh

or similar constructs.
--
Kees Nuyt

Re: OpenSSL: Decrypt/Encrypt with same file name

<5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3944&group=comp.unix.shell#3944

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a05:620a:2225:: with SMTP id n5mr975337qkh.38.1623860958232;
Wed, 16 Jun 2021 09:29:18 -0700 (PDT)
X-Received: by 2002:a37:642:: with SMTP id 63mr888158qkg.400.1623860957904;
Wed, 16 Jun 2021 09:29:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Wed, 16 Jun 2021 09:29:17 -0700 (PDT)
In-Reply-To: <87lf88qg48.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=122.172.252.98; posting-account=9j_33QoAAADW1Zm5MU4cyLLhykHRk2Mj
NNTP-Posting-Host: 122.172.252.98
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com> <87lf88qg48.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
From: gpar...@gmail.com (gpa...@gmail.com)
Injection-Date: Wed, 16 Jun 2021 16:29:18 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gpa...@gmail.com - Wed, 16 Jun 2021 16:29 UTC

On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:
> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>
> > I need to Decrypt/Encrypt a file in the same name, but is this allowed?
> Why do you need to? I know this the sort of answer people hate to get,
> but it's generally a bad idea to try to do this.
> > My project script is available in the Encrypted format . I need to
> > perform the the following steps .
> >
> > 1. Decrypt the project file
> > 2. Execute the the project by running the file
> Technically you don't do this. "Sourcing" the file is not the same as
> running it.
> > 3. Encrypt the project file back
> >
> > openssl enc -aes-256-cbc -pass pass:password -d -p -base64 -in ./run1.sh -out run1.sh
> > source ./run1.sh
> > openssl enc -aes-256-cbc -pass pass:password -p -base64 -in ./run1.sh -out ./run1.sh
> >
> > Please suggest a solution for the above problem.
> I would not store the decrypted file at all:
>
> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> -in ./run1.sh -out - | source /dev/stdin
>
> and unless you really need to source it, I'd pass it to a shell:
>
> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> -in ./run1.sh -out - | sh
>
> To address your original question, you can't use the file for the input
> and the output, but you can use the same name provided you move one out
> of the way. So move the source, decrypt to the old name and then remove
> the source or decrypt to a new name and the rename it. This can lose
> you your data unless you check the everything went well.
>
> --
> Ben.

Hi Experts,

Thanks a lot for the above solution and worked well.
For generic scripts (.tcl, .sh) which are run in shell and not used in any EDA tool flow , it worked well.
(decrypting on the fly without storing, it on disk pass it to a shell)

Now, to use it same procedure in an EDA tool environment, how can we handle the scenario of decrypt and run a tool run command in the shell ?
EDA tool specific commands to be run in shell as shown below where run1.tcl.aes is an encrypted file

/tools/bin/vivado -mode batch -source run1.tcl.aes

Best Regards
Parth

Re: OpenSSL: Decrypt/Encrypt with same file name

<87v96dk1gj.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3946&group=comp.unix.shell#3946

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Wed, 16 Jun 2021 21:18:36 +0100
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <87v96dk1gj.fsf@bsb.me.uk>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
<87lf88qg48.fsf@bsb.me.uk>
<5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="25ed65266badac06b20a98d17b6edd2c";
logging-data="5625"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19GzpSlWA3Md10kzfmwiQsSMNVqhrsk1cg="
Cancel-Lock: sha1:FDA3IqfOAWgAUpb1CunW1aTj7q4=
sha1:Lt42riUKHnSVTadOjtnU/z+KtjM=
X-BSB-Auth: 1.759bfcebb9082918baaa.20210616211836BST.87v96dk1gj.fsf@bsb.me.uk
 by: Ben Bacarisse - Wed, 16 Jun 2021 20:18 UTC

"gpa...@gmail.com" <gparthu@gmail.com> writes:

> On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:

>> I would not store the decrypted file at all:
>>
>> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> -in ./run1.sh -out - | source /dev/stdin
>>
>> and unless you really need to source it, I'd pass it to a shell:
>>
>> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> -in ./run1.sh -out - | sh

> Thanks a lot for the above solution and worked well.
> For generic scripts (.tcl, .sh) which are run in shell and not used in
> any EDA tool flow , it worked well. (decrypting on the fly without
> storing, it on disk pass it to a shell)
>
> Now, to use it same procedure in an EDA tool environment, how can we
> handle the scenario of decrypt and run a tool run command in the shell
> ?

I've no idea what an EDA tool environment is. Unix/Linux tools are
often designed to work as part of a pipeline. Maybe EDA tools are not?

> EDA tool specific commands to be run in shell as shown below where
> run1.tcl.aes is an encrypted file
>
> /tools/bin/vivado -mode batch -source run1.tcl.aes

It all depends on what this program (about which I know nothing) is
doing an how it goes about doing it.

At a guess, I'd try

openssl enc -d ...other options... -in ./run1.sh -out - |\
/tools/bin/vivado -mode batch -source /dev/stdin

Does vivado have a man page? I.e. what does "man vivado" say once
you've installed whatever it is that this program is part of?

--
Ben.

Re: OpenSSL: Decrypt/Encrypt with same file name

<7088c08a-a8ff-46a2-bc4d-03bf73682627n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3950&group=comp.unix.shell#3950

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a37:781:: with SMTP id 123mr1254355qkh.296.1623923819138;
Thu, 17 Jun 2021 02:56:59 -0700 (PDT)
X-Received: by 2002:a37:642:: with SMTP id 63mr2865862qkg.400.1623923818647;
Thu, 17 Jun 2021 02:56:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 17 Jun 2021 02:56:58 -0700 (PDT)
In-Reply-To: <87v96dk1gj.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=122.172.252.98; posting-account=9j_33QoAAADW1Zm5MU4cyLLhykHRk2Mj
NNTP-Posting-Host: 122.172.252.98
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
<87lf88qg48.fsf@bsb.me.uk> <5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
<87v96dk1gj.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7088c08a-a8ff-46a2-bc4d-03bf73682627n@googlegroups.com>
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
From: gpar...@gmail.com (gpa...@gmail.com)
Injection-Date: Thu, 17 Jun 2021 09:56:58 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gpa...@gmail.com - Thu, 17 Jun 2021 09:56 UTC

On Thursday, June 17, 2021 at 1:48:41 AM UTC+5:30, Ben Bacarisse wrote:
> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>
> > On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:
>
> >> I would not store the decrypted file at all:
> >>
> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> >> -in ./run1.sh -out - | source /dev/stdin
> >>
> >> and unless you really need to source it, I'd pass it to a shell:
> >>
> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> >> -in ./run1.sh -out - | sh
> > Thanks a lot for the above solution and worked well.
> > For generic scripts (.tcl, .sh) which are run in shell and not used in
> > any EDA tool flow , it worked well. (decrypting on the fly without
> > storing, it on disk pass it to a shell)
> >
> > Now, to use it same procedure in an EDA tool environment, how can we
> > handle the scenario of decrypt and run a tool run command in the shell
> > ?
> I've no idea what an EDA tool environment is. Unix/Linux tools are
> often designed to work as part of a pipeline. Maybe EDA tools are not?
> > EDA tool specific commands to be run in shell as shown below where
> > run1.tcl.aes is an encrypted file
> >
> > /tools/bin/vivado -mode batch -source run1.tcl.aes
> It all depends on what this program (about which I know nothing) is
> doing an how it goes about doing it.
>
> At a guess, I'd try
>
> openssl enc -d ...other options... -in ./run1.sh -out - |\
> /tools/bin/vivado -mode batch -source /dev/stdin
>
> Does vivado have a man page? I.e. what does "man vivado" say once
> you've installed whatever it is that this program is part of?
>
> --
> Ben.

Required vivado synthesis command is "vivado -mode batch -source run1.tcl" where vivado looks for a tcl file as input in batch mode.

vivado [-mode <arg>] [-init] [-source <arg>] [-nojournal] [-appjournal],
[-journal <arg>] [-nolog] [-applog] [-log <arg>] [-version]
[-tclargs <arg>] [-tempDir <arg>] [-robot <arg>] [-verbose] [<project>]

Usage:
Name Description
--------------------------
[-mode] Invocation mode, allowed values are 'gui', 'tcl', and 'batch' Default: gui
[-source] Source the specified Tcl file
[-nojournal] Do not create a journal file
[-journal] Journal file name Default: vivado.jou
[-nolog] Do not create a log file
[-applog] Open log file in append mode
[-log] Log file name
[-tclargs] Arguments passed on to tcl argc argv
[-tempDir] Temporary directory name.

Re: OpenSSL: Decrypt/Encrypt with same file name

<8735tgkcat.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3951&group=comp.unix.shell#3951

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Thu, 17 Jun 2021 11:36:42 +0100
Organization: A noiseless patient Spider
Lines: 66
Message-ID: <8735tgkcat.fsf@bsb.me.uk>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
<87lf88qg48.fsf@bsb.me.uk>
<5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
<87v96dk1gj.fsf@bsb.me.uk>
<7088c08a-a8ff-46a2-bc4d-03bf73682627n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="dba4e90f2d9a52676a13a099c8050f76";
logging-data="31400"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//yQaeI0700YaUKH50Rs/KlvR7XWF16Lo="
Cancel-Lock: sha1:mHym4MeRKGzWx2k55kKrBZJd2GI=
sha1:VMgj8RusONRgIyw70WO9JMSdwuM=
X-BSB-Auth: 1.0f8323718dfdd68b2f8e.20210617113642BST.8735tgkcat.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 17 Jun 2021 10:36 UTC

"gpa...@gmail.com" <gparthu@gmail.com> writes:

> On Thursday, June 17, 2021 at 1:48:41 AM UTC+5:30, Ben Bacarisse wrote:
>> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>>
>> > On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:
>>
>> >> I would not store the decrypted file at all:
>> >>
>> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> >> -in ./run1.sh -out - | source /dev/stdin
>> >>
>> >> and unless you really need to source it, I'd pass it to a shell:
>> >>
>> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> >> -in ./run1.sh -out - | sh
>> > Thanks a lot for the above solution and worked well.
>> > For generic scripts (.tcl, .sh) which are run in shell and not used in
>> > any EDA tool flow , it worked well. (decrypting on the fly without
>> > storing, it on disk pass it to a shell)
>> >
>> > Now, to use it same procedure in an EDA tool environment, how can we
>> > handle the scenario of decrypt and run a tool run command in the shell
>> > ?
>> I've no idea what an EDA tool environment is. Unix/Linux tools are
>> often designed to work as part of a pipeline. Maybe EDA tools are not?
>> > EDA tool specific commands to be run in shell as shown below where
>> > run1.tcl.aes is an encrypted file
>> >
>> > /tools/bin/vivado -mode batch -source run1.tcl.aes
>> It all depends on what this program (about which I know nothing) is
>> doing an how it goes about doing it.
>>
>> At a guess, I'd try
>>
>> openssl enc -d ...other options... -in ./run1.sh -out - |\
>> /tools/bin/vivado -mode batch -source /dev/stdin
>>
>> Does vivado have a man page? I.e. what does "man vivado" say once
>> you've installed whatever it is that this program is part of?
>>
> Required vivado synthesis command is "vivado -mode batch -source
> run1.tcl" where vivado looks for a tcl file as input in batch mode.
>
> vivado [-mode <arg>] [-init] [-source <arg>] [-nojournal] [-appjournal],
> [-journal <arg>] [-nolog] [-applog] [-log <arg>] [-version]
> [-tclargs <arg>] [-tempDir <arg>] [-robot <arg>] [-verbose] [<project>]
>
> Usage:
> Name Description
> --------------------------
> [-mode] Invocation mode, allowed values are 'gui', 'tcl', and 'batch' Default: gui
> [-source] Source the specified Tcl file
> [-nojournal] Do not create a journal file
> [-journal] Journal file name Default: vivado.jou
> [-nolog] Do not create a log file
> [-applog] Open log file in append mode
> [-log] Log file name
> [-tclargs] Arguments passed on to tcl argc argv
> [-tempDir] Temporary directory name.

This adds almost no useful information (that's not your fault!). Did my
guess work or not?

--
Ben.

Re: OpenSSL: Decrypt/Encrypt with same file name

<0d20481f-1f05-4567-9140-d10a2d71728dn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3952&group=comp.unix.shell#3952

  copy link   Newsgroups: comp.unix.shell
X-Received: by 2002:a37:a38d:: with SMTP id m135mr3585104qke.36.1623934178534;
Thu, 17 Jun 2021 05:49:38 -0700 (PDT)
X-Received: by 2002:a37:bc04:: with SMTP id m4mr3650991qkf.100.1623934178207;
Thu, 17 Jun 2021 05:49:38 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.unix.shell
Date: Thu, 17 Jun 2021 05:49:37 -0700 (PDT)
In-Reply-To: <8735tgkcat.fsf@bsb.me.uk>
Injection-Info: google-groups.googlegroups.com; posting-host=122.172.252.98; posting-account=9j_33QoAAADW1Zm5MU4cyLLhykHRk2Mj
NNTP-Posting-Host: 122.172.252.98
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
<87lf88qg48.fsf@bsb.me.uk> <5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
<87v96dk1gj.fsf@bsb.me.uk> <7088c08a-a8ff-46a2-bc4d-03bf73682627n@googlegroups.com>
<8735tgkcat.fsf@bsb.me.uk>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0d20481f-1f05-4567-9140-d10a2d71728dn@googlegroups.com>
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
From: gpar...@gmail.com (gpa...@gmail.com)
Injection-Date: Thu, 17 Jun 2021 12:49:38 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gpa...@gmail.com - Thu, 17 Jun 2021 12:49 UTC

On Thursday, June 17, 2021 at 4:06:46 PM UTC+5:30, Ben Bacarisse wrote:
> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>
> > On Thursday, June 17, 2021 at 1:48:41 AM UTC+5:30, Ben Bacarisse wrote:
> >> "gpa...@gmail.com" <gpa...@gmail.com> writes:
> >>
> >> > On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:
> >>
> >> >> I would not store the decrypted file at all:
> >> >>
> >> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> >> >> -in ./run1.sh -out - | source /dev/stdin
> >> >>
> >> >> and unless you really need to source it, I'd pass it to a shell:
> >> >>
> >> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
> >> >> -in ./run1.sh -out - | sh
> >> > Thanks a lot for the above solution and worked well.
> >> > For generic scripts (.tcl, .sh) which are run in shell and not used in
> >> > any EDA tool flow , it worked well. (decrypting on the fly without
> >> > storing, it on disk pass it to a shell)
> >> >
> >> > Now, to use it same procedure in an EDA tool environment, how can we
> >> > handle the scenario of decrypt and run a tool run command in the shell
> >> > ?
> >> I've no idea what an EDA tool environment is. Unix/Linux tools are
> >> often designed to work as part of a pipeline. Maybe EDA tools are not?
> >> > EDA tool specific commands to be run in shell as shown below where
> >> > run1.tcl.aes is an encrypted file
> >> >
> >> > /tools/bin/vivado -mode batch -source run1.tcl.aes
> >> It all depends on what this program (about which I know nothing) is
> >> doing an how it goes about doing it.
> >>
> >> At a guess, I'd try
> >>
> >> openssl enc -d ...other options... -in ./run1.sh -out - |\
> >> /tools/bin/vivado -mode batch -source /dev/stdin
> >>
> >> Does vivado have a man page? I.e. what does "man vivado" say once
> >> you've installed whatever it is that this program is part of?
> >>
> > Required vivado synthesis command is "vivado -mode batch -source
> > run1.tcl" where vivado looks for a tcl file as input in batch mode.
> >
> > vivado [-mode <arg>] [-init] [-source <arg>] [-nojournal] [-appjournal],
> > [-journal <arg>] [-nolog] [-applog] [-log <arg>] [-version]
> > [-tclargs <arg>] [-tempDir <arg>] [-robot <arg>] [-verbose] [<project>]
> >
> > Usage:
> > Name Description
> > --------------------------
> > [-mode] Invocation mode, allowed values are 'gui', 'tcl', and 'batch' Default: gui
> > [-source] Source the specified Tcl file
> > [-nojournal] Do not create a journal file
> > [-journal] Journal file name Default: vivado.jou
> > [-nolog] Do not create a log file
> > [-applog] Open log file in append mode
> > [-log] Log file name
> > [-tclargs] Arguments passed on to tcl argc argv
> > [-tempDir] Temporary directory name.
> This adds almost no useful information (that's not your fault!). Did my
> guess work or not?
>
> --
> Ben.

No, it didn't work.

openssl enc -aes-256-cbc -pass pass:password -base64 -d -in ./run1.tcl.encr -out - | vivado -mode batch -source /dev/stdin

above command fails with the following error

source /dev/stdin
INFO: [Common 17-206] Exiting Vivado at Thu Jun 17 18:12:49 2021...

Re: OpenSSL: Decrypt/Encrypt with same file name

<874kdwi9qm.fsf@bsb.me.uk>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=3954&group=comp.unix.shell#3954

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ben.use...@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.unix.shell
Subject: Re: OpenSSL: Decrypt/Encrypt with same file name
Date: Thu, 17 Jun 2021 20:14:57 +0100
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <874kdwi9qm.fsf@bsb.me.uk>
References: <0fa2fc32-2190-4d0d-a554-2e753028b9ben@googlegroups.com>
<87lf88qg48.fsf@bsb.me.uk>
<5451dd9f-7038-4aa8-8aab-28daebd99b34n@googlegroups.com>
<87v96dk1gj.fsf@bsb.me.uk>
<7088c08a-a8ff-46a2-bc4d-03bf73682627n@googlegroups.com>
<8735tgkcat.fsf@bsb.me.uk>
<0d20481f-1f05-4567-9140-d10a2d71728dn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="dba4e90f2d9a52676a13a099c8050f76";
logging-data="26680"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CiX/2VlMFGaLf4bZS6D2AH2NETdt9QHk="
Cancel-Lock: sha1:hziMqlNuK1qgyA+dIu7twPBxT6A=
sha1:FRxxi1N9DLQePdSVf3A172FN3N0=
X-BSB-Auth: 1.d558dcd95bb58e7dac11.20210617201457BST.874kdwi9qm.fsf@bsb.me.uk
 by: Ben Bacarisse - Thu, 17 Jun 2021 19:14 UTC

"gpa...@gmail.com" <gparthu@gmail.com> writes:

> On Thursday, June 17, 2021 at 4:06:46 PM UTC+5:30, Ben Bacarisse wrote:
>> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>>
>> > On Thursday, June 17, 2021 at 1:48:41 AM UTC+5:30, Ben Bacarisse wrote:
>> >> "gpa...@gmail.com" <gpa...@gmail.com> writes:
>> >>
>> >> > On Friday, May 21, 2021 at 8:38:28 PM UTC+5:30, Ben Bacarisse wrote:
>> >>
>> >> >> I would not store the decrypted file at all:
>> >> >>
>> >> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> >> >> -in ./run1.sh -out - | source /dev/stdin
>> >> >>
>> >> >> and unless you really need to source it, I'd pass it to a shell:
>> >> >>
>> >> >> openssl enc -aes-256-cbc -pass pass:password -base64 -d \
>> >> >> -in ./run1.sh -out - | sh
>> >> > Thanks a lot for the above solution and worked well.
>> >> > For generic scripts (.tcl, .sh) which are run in shell and not used in
>> >> > any EDA tool flow , it worked well. (decrypting on the fly without
>> >> > storing, it on disk pass it to a shell)
>> >> >
>> >> > Now, to use it same procedure in an EDA tool environment, how can we
>> >> > handle the scenario of decrypt and run a tool run command in the shell
>> >> > ?
>> >> I've no idea what an EDA tool environment is. Unix/Linux tools are
>> >> often designed to work as part of a pipeline. Maybe EDA tools are not?
>> >> > EDA tool specific commands to be run in shell as shown below where
>> >> > run1.tcl.aes is an encrypted file
>> >> >
>> >> > /tools/bin/vivado -mode batch -source run1.tcl.aes
>> >> It all depends on what this program (about which I know nothing) is
>> >> doing an how it goes about doing it.
>> >>
>> >> At a guess, I'd try
>> >>
>> >> openssl enc -d ...other options... -in ./run1.sh -out - |\
>> >> /tools/bin/vivado -mode batch -source /dev/stdin
>> >>
>> >> Does vivado have a man page? I.e. what does "man vivado" say once
>> >> you've installed whatever it is that this program is part of?
>> >>
>> > Required vivado synthesis command is "vivado -mode batch -source
>> > run1.tcl" where vivado looks for a tcl file as input in batch mode.
>> >
>> > vivado [-mode <arg>] [-init] [-source <arg>] [-nojournal] [-appjournal],
>> > [-journal <arg>] [-nolog] [-applog] [-log <arg>] [-version]
>> > [-tclargs <arg>] [-tempDir <arg>] [-robot <arg>] [-verbose] [<project>]
>> >
>> > Usage:
>> > Name Description
>> > --------------------------
>> > [-mode] Invocation mode, allowed values are 'gui', 'tcl', and 'batch' Default: gui
>> > [-source] Source the specified Tcl file
>> > [-nojournal] Do not create a journal file
>> > [-journal] Journal file name Default: vivado.jou
>> > [-nolog] Do not create a log file
>> > [-applog] Open log file in append mode
>> > [-log] Log file name
>> > [-tclargs] Arguments passed on to tcl argc argv
>> > [-tempDir] Temporary directory name.
>> This adds almost no useful information (that's not your fault!). Did my
>> guess work or not?
>>
>
> No, it didn't work.
>
> openssl enc -aes-256-cbc -pass pass:password -base64 -d -in ./run1.tcl.encr -out - | vivado -mode batch -source /dev/stdin
>
> above command fails with the following error
>
> source /dev/stdin
> INFO: [Common 17-206] Exiting Vivado at Thu Jun 17 18:12:49 2021...

I thought error codes went out of fashion in the 1970s! What is error
Common 17-206?

Anyway, maybe vivado needs a seekable input in which case it won't ever
work. It certainly does not appear to be written as a Unix-like tool.

You may have to store the un-encrypted source as a file. How sensitive
are the contents? If they are very sensitive, even a pipe is not really
safe.

--
Ben.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor