Questions tagged [phpseclib]

phpseclib is a PHP library that provides pure-PHP implementations of: - BigIntegers - ECDSA / ECDH (66 curves supported) - Ed25519 / Ed448 - Curve25519 / Curve448 - RSA - DSA - DH - SSH2 - SFTP - X.509 - Symmetric key encryption - AES - Rijndael - DES - 3DES - RC4 - Blowfish - Twofish - ChaCha20 - GCM - Poly1305

phpseclib is a PHP library that provides pure-PHP implementations of:

  • BigIntegers
  • RSA
  • SSH1
  • SSH2
  • SFTP
  • SCP
  • ASN1
  • X.509
  • Symmetric key encryption
  • AES
  • Rijndael
  • DES
  • 3DES
  • RC4
  • Blowfish
  • Twofish

Repository at GitHub: https://github.com/phpseclib/phpseclib

839 questions
4
votes
3 answers

phpseclib gives me a strange erros

Im trying to use this, but it just gives me this errors and i have no clue how to fix that.. Warning: include_once(Math/BigInteger.php): failed to open stream: No such file or directory in …
shelly
  • 309
  • 3
  • 14
4
votes
1 answer

Public/private key encryption Android-PHP

I'm trying to encrypt data in android side and decrypt it in php side i'm using phpseclib in php to generate public/private keys after i generate keys this public key i got in PHP side : -----BEGIN RSA PUBLIC KEY-----". …
4
votes
2 answers

Unable to connect with Net_SSH2 from inside Apache

I am attempting to SSH from PHP but I get the following error: Notice: Cannot connect to [host]. Error 13. Permission denied in /usr/share/php/Net/SSH2.php on line 875 Here is the code:
wesmat
  • 85
  • 1
  • 10
4
votes
2 answers

Check is SFTP directory exists before trying to create it using phpseclib

I have the following function in my model: public function createfolder($location, $name){ define('NET_SFTP_LOGGING', NET_SFTP_LOG_COMPLEX); $sftp = new Net_SFTP('xx.xxx.xx.xx'); if (!$sftp->login('admin', '********')) { …
Someone
  • 894
  • 3
  • 22
  • 43
4
votes
1 answer

SFTP remove files with wildcard characters

I tried to use phpseclib to delete all logs in SFTP server. Codes are simple: $sftp = new Net_SFTP($host_name); $sftp->login($username, $password); // login is successful $sftp->chdir('/somefolder'); if(!$sftp->delete('*.log')) { …
Raptor
  • 53,206
  • 45
  • 230
  • 366
4
votes
2 answers

Connect to a mysql database via SSH through PHP

I have already written a php file that connects to the mysql database locally. Now, I want to connect to a remote database via SSH. Currently the connect function for my database is the following in php: $this->db = new mysqli(_SERVR_URL,…
Lugubrious
  • 380
  • 1
  • 3
  • 16
4
votes
5 answers

How to SFTP upload files from PHP

I'm having trouble using PHP to SFTP upload files to a remote server. When I use cURL, I'm getting the error described here: SFTP from PHP - undefined constant CURLOPT_PROTOCOLS and CURLPROTO_SFTP? I also tried phpseclib as suggested in: SFTP from…
John
  • 32,403
  • 80
  • 251
  • 422
3
votes
1 answer

Compatibility rsa.js and rsa.php

I have an web site and i'm trying to make my forms secure. I've done some research and even though I'm not no programmer, i'm authenticating users via a home made challenge-response mechanism and I'm encrypting form values using aes encryption from…
Rivas
  • 31
  • 3
3
votes
1 answer

Verify RSA-PSS With phpseclib

So i tried to verify rsa-ps signature that signed in golang with php library phpseclib v3. The php verification keep getting me an error. But what makes me confuse is when i try sign the signature in php and verify that in both golang and php it…
Devanser
  • 33
  • 3
3
votes
1 answer

RSA encryption in Java, decryption in PHP

I am trying to encrypt an AES key with an RSA public key in and Android app and then decrypt the AES key on a server using PHP with phpseclib. I have tested to make sure that the RSA encryption/decryption work on both platforms by encrypting a…
UmangB
  • 55
  • 1
  • 6
3
votes
0 answers

Javascript not decrypt, laravel RSA encrypted string

Problem Statement I need to encrypt details in Laravel using RSA algorithm and then decrypt in Javascript. Efforts Done In laravel I am using phpseclib library to encrypt. Laravel code to encrypt string is given below... $publicKey=…
shujat132
  • 59
  • 1
  • 11
3
votes
1 answer

Verify signature of Private key by Public key between Sender and Receiver in PHP

I create a Signature() function for the sender to sign his/her private key and then return the $signature use phpseclib\Crypt\RSA; public function Signature(Request $request) { $agent_code = $request->agent_code; $private_key =…
Wei Kang
  • 163
  • 2
  • 9
3
votes
1 answer

PHP authentication with ppk, rsa, pkcs8

I'm very new to PHP. I'm trying to run a PHP script (from my windows box) that simply SSH's into a bunch of linux servers (Net/SSH2.php) using in a list, runs one bash command on each server, and dumps the findings into a file. It worked perfectly…
Ashmai
  • 33
  • 4
3
votes
1 answer

How to fix "invalid key format" while read public or private key from file?

I have created the public and private key . The public and private key generated from php code : createKey()); …
Xihar
  • 103
  • 1
  • 12
3
votes
1 answer

phpseclib put returns true but file is not uploaded

Using the PHP plugin phpseclib v2.0.18 with PHP 7.3, when I try to upload a file to the SFTP server, the put() method returns true, but the file is never uploaded. The log say that everything is ok. My code: foreach ($schedules as $idx =>…
Jomiquel
  • 45
  • 4
1 2
3
55 56