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

793 questions
13
votes
4 answers

How to install phpseclib?

I have installed Apache on my machine so I can use localhost as a PHP server. That works. Right now I am trying to use PHP to send files via SFTP to another server. I looked around a bit and saw phpseclib was recommended. I can't seem to figure out…
Diego
  • 163
  • 1
  • 1
  • 9
12
votes
3 answers

How to use phpseclib to verify that a certificate is signed by a public CA?

I have a need to ensure that an SMTP server certificate is signed by a public certificate authority. I would like to use phpseclib or some other trusted library. I believe I can use the root certificates extracted from Firefox. There are some…
halfer
  • 18,701
  • 13
  • 79
  • 158
12
votes
4 answers

set_include_path(get_include_path() . PATH_SEPARATOR . 'phpseclib');

I have stumbled upon two functions i have never used before in php set_include_path(); get_include_path(); I am currently looking to implement the phpseclib onto a project I am working on.. As i need to use the SFTP class extension of the SSH2…
John
  • 4,512
  • 8
  • 48
  • 98
9
votes
4 answers

Encryption PHP, Decryption Java

I have a web-service in php that generates a keypair to encrypt a message, and one application in java that retrives the privatekey and decrypt the message. For php I'm using http://phpseclib.sourceforge.net/ and have this two…
9
votes
2 answers

removing password from rsa private key

Here's how I'd do it with phpseclib (which works): setPassword('password'); $result = $rsa->loadKey('-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info:…
user1469439
8
votes
1 answer

Exact alternate to mcrypt_encrypt in PHP 7.2

Since mcrypt_encrypt is no longer supported in PHP 7.2, I am trying for exact alternate to this function. After reading many SO answers I have found the following code which uses PHPSECLIB, but it's not producing the exact encrypted text as…
user1918906
  • 85
  • 1
  • 4
8
votes
1 answer

composer install pear package

I know you can install packages from any pear channel, and I have this working on a basic pear package ... "repositories": [ { "type": "pear", "url": "http://pear.php.net" } ], "require-dev": { "pear-pear/Mail":…
veilig
  • 4,785
  • 9
  • 41
  • 80
7
votes
3 answers

Transfer large file via SFTP in PHP

I have a large file (200 MB upwards). I need to transfer it via PHP cron job. Using Phpseclib gives the following error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4133 bytes) in…
Abhishek
  • 1,440
  • 3
  • 18
  • 34
7
votes
1 answer

How To Get Error Mesage From PHPSECLIB $sftp->put

I am using PHPseclib to transfer a file from a local fileserver to a remote fileserver. I am able to connect to the server, have 0777 permission on the target file on my local fileserver, but $sftp->put is failing. Right now it return bool, but is…
Bad Programmer
  • 3,314
  • 11
  • 41
  • 53
7
votes
2 answers

How to catch un-handled errors with PHPseclib?

Let's say I have the following piece of code. To test this, I change the server IP to mimic the error messages. The IP below doesn't exist so the Unhandled Exception message is: Cannot connect to 10.199.1.7. Error 113. No route to host This displays…
sdot257
  • 9,100
  • 24
  • 78
  • 115
6
votes
2 answers

PHP Telnet/SSH dynamic login

I have an issue that's stumped me. I'm trying to automate a CLI login to a router and run some commands obtained via a webpage. However I don't know if the router has telnet or SSH enabled (might be one,the other, or both) and I have a list of…
Cynikal
  • 63
  • 5
6
votes
1 answer

"Segmentation fault" when using phpseclib

I downloaded phpseclib-0.3.10 from http://phpseclib.sourceforge.net/ My php Version : PHP 5.2.4 OS : CentOS release 6.6 When I run following I am getting "Segmentation fault" at this line $ssh->login('username',…
6
votes
1 answer

Using phpseclib to close a Net_SFTP connection

I have a program written in PHP that distributes files to various FTP sites. Recently, I added SFTP support to it using phpseclib. It's very easy to use to log in and upload the files. However, there doesn't seem to be an explicit function to close…
David Spencer
  • 67
  • 1
  • 9
6
votes
1 answer

RSA Publickey implemenation in android

I have implemented RSA cryptography using in php, javascript, and android app using library: phpseclib for php side pidcrypt for javascript bouncrycastle version(bcprov-jdk14-151) for anrdroid serviceprovider I have my cryptography mechanism…
Asif Bakht
  • 81
  • 5
6
votes
1 answer

Upload files to SFTP server via PHP (phpseclib)

I have CSVs that I want to upload to the 'incoming' folder in the SFTP server. I am using phpseclib to do this. The connection is already there but it does not output anything. I'm not sure if what I did was correct since I haven't dealt with SFTP…
maikelsabido
  • 1,183
  • 4
  • 15
  • 37
1
2 3
52 53