Travis-CI openssl aes-256-cbc bad decrypt "Wrong final block" - encryption

i use following travis-ci-cli command to create an encrypted-file:
travis encrypt-file src/env/data.ts src/env/data.ts.enc --add
It creates the file and related key and value on the Travis-CI.
You can see error of travis
Why do i get the wrong final block length here?

This error is a known problem when encrypting files using the Travis CLI on Windows.
Travis provides a guide here that will help you encrypt your local files with a passphrase and then store that passphrase using travis encrypt.
If you'd rather not do that, you'll have to either use Windows Subsystem for Linux or use a Linux VM to run travis encrypt-file.

Related

Execute this command line in Windows

I'm trying to connect my firebase auth to an expo project.
I'm following the main docs of each library. I'm stucking on this step.
I'm not able in windows to exeute this command line openssl rand -base64 32 | openssl sha1 -c.
I've tried with the specific https://code.google.com/archive/p/openssl-for-windows/downloads but I don't know how to reproduce the same line.
Any help would be great, thanks in advance.
You need to install openssl. It is usually available on Linux (which I think that article might have been written for). There are some Windows binaries available at here. Alternatively, you could setup a WSL session, and run the command from there.
that is a linux command. Therefore a linux terminal is needed.
there are at least 2 ways to get this done
using virtual machine with ubuntu or some other operating system that uses a linux terminal aka shell (which I doubt you know about)
OR
installing a linux emulator (windows 8+ since it's from the windows store)
assuming you would prefer option 2, go to the windows store, search "Kali" and you will find an app called Kali. install it and if an error shows up, here's a nice video here that talks about solving that error and you would have a kali terminal on your windows computer (your command would work there)

Unable to connect Cassandra CQL shell to Azure-CosmosDB

I have entered the following command on my windows cql shell
set SSL_VERSION=TLSv1_2;
and got this error
No viable alternative at input 'set'([set]..)
Are you getting this error when you atemmpt to set the variable or upon launching the cqlsh cmd?
Please ensure you have the two following variables set, where SSL_CERTFILE references a trusted root ca bundle. This is the trusted root bundle from an OpenSSL install on Ubuntu.
export SSL_VERSION=TLSv1_2
export SSL_CERTFILE=/usr/lib/ssl/certs/ca-certificates.crt
Optionally, you can use: export SSL_VALIDATE=true should there be any concerns with the certificate.
In windows, you use set instead of export.
Use export in place of set. Export is used for Linux and Serbia used for windows

"Value was either too large or too small for a UInt64" using a .PFX Certificate

I am using Webpay, which is Chilean most used payment platform to accept Credit Card. I have done that succesfully in the past (on 4 websites) but on my latest one things are not going as planned. Two weeks have passed and quite a few mails between myself and Webpay's support but I didnt' move one centimeter.
To use this system I am using a library they created they are two steps: the first one is the "INTEGRATION" one, using generic certificates, I went thru this step without a problem.
Then there is the "PRODUCTION" step where I needed to generate the .key .csr and .pfx Certificates. Which I did as I done before using Win64 OpenSSL found here using those commands:
openssl genrsa -out 597034189528.key 2048
openssl req -new -key 597034189528.key -out 597034189528.csr
openssl x509 -req -days 1460 -in 597034189528.csr -signkey 597034189528.key -out 597034189528.crt
openssl pkcs12 -export -out 597034189528.pfx -inkey 597034189528.key -in 597034189528.crt
But when using the generated .PFX and running the code I got an error message saying "Value was either too large or too small for a UInt64". This occurs when calling the library at this point
wsInitTransactionOutput result = webpay.getNormalTransaction().initTransaction(amount, buyOrder, sessionId, urlReturn, urlFinal);
Since then I tried generating and regenerating again the .PFX (using different versions of the Win64 OpenSSL) but it didn't change a thing Webpay's support keeps saying that there is something wrong with the certificate.
Anybody around having had a similar issue with certificates ?
If someone feels like trying it please feel free to do so. I uploaded here the library they are providing. Somewhere inside the ZIP file look for transbank.net and run a "webpay Normal" transaction. I am getting this:
At this stage I am blind, I guess the solution is so obvious that I can't see it.
Solved !
It took time but I got to the bottom of this issue.
The certificate I originally generated was created using the latest version of OpenSSL, which was at that time version 1.1.0. The certificates that Transbank's library (the creator of WebPay) was expecting had to be generated with a OpenSSL 1.0.x version (serial number's size are different). I generated again the certificate with OpenSSL 1.0.2q: the library behaved properly and payment went thru fine. I suggested to the provider that the documentation to be amended by specifying the OpenSSL's version.

GnuPG error version 2.0.14

When i try to encrypt a file using GnuPG the
-----BEGIN PGP MESSAGE----- is added but in the same file the -----END PGP MESSAGE----- is not added in the encrypted file using a java program. When the number of files processed is more this error is noticed. This results in a decryption error
gpg: no valid OpenPGP data found.
gpg: block_filter 0x2656130: read error (size=13663,a->size=13663)
I am using GnuPG version 2.0.14 in Linux environment. Any help on this will be appreciated
The problem was due to a bug in the program. The encrypted file contents was getting truncated. The program uses Runtime. Exec method and was not handling the input stream properly. The issue was not with GnuPG encryption tool.

SQL Chiper command line

Can anybody advice me what I need to do in order to open ciphered (http://sqlcipher.net/) database in command line.
When I try to do something with it like watch schema it response with following message
sqlite> .schema
Error: file is encrypted or is not a database
I know password for db, I just want to figure out steps how to correctly open it. My OS is Ubuntu 11.10
Finally I managed to do that, in case if somebody need it, here is my steps:
I've started from http://sqlcipher.net/introduction/ & downloaded sqlcipher.
The first problem was for me that I was unable to configure and build it from source because I have no libcrypto.a which is part of openssl crypto libraries.
I've installed it apt-get install libssl-dev
Then I successfully configured sqlcipher running
$./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
$make
after that executable sqlite3 file was created and I was able to open ciphered database.
To provide a password you should execute following statement.
PRAGMA key='password'

Resources