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
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

How do i use phpseclib to upload file from my php server -> someOther server?

I'm trying to upload a file from my php server to some other server (my workplace is quite lame enough to block ssh traffic) Anyway, here's what I'm trying to do: (at: /public_html/manage.php
user1894397
  • 333
  • 2
  • 4
  • 9
6
votes
4 answers

using phpseclib with net_ssh how to su to root using $ssh->exec

So i need to execute one command but it will only run if i su to root (or sudo ) but I can't seem to figure out how to send the command to su to root (i can log in and execute other commands with loginuser…
Crash893
  • 11,428
  • 21
  • 88
  • 123
6
votes
2 answers

PHP FTP/SFTP switch class

OK, so accessing other servers from your own via either ftp or sftp... I have written a small class to handle either.. It is obviously new and could easily be improved so thought i would throw it out here and see what other people think…
user1037355
5
votes
3 answers

PHP: read a remote file (ideally using fopen)

I'd like to read a remote text file (ideally using fopen) using PHP. My script works using fopen when I'm using this function on a local file. I've tried: $file = fopen ("http://abc.abc.abc", "r"); if (!$file) { echo "

Unable to open remote…

sims
  • 145
  • 2
  • 11
5
votes
3 answers

Composer: conflict with your requirements or minimum-stability

I'm trying to run composer require phpseclib/mcrypt_compat:dev-master in an empty directory and am getting the following error: ./composer.json has been created Loading composer repositories with package information Updating dependencies (including…
neubert
  • 15,947
  • 24
  • 120
  • 212
5
votes
2 answers

Secure communication PHP (phpseclib) and C# (Unity 3D)

im trying to establish secure RSA connection between PHP server and Unity 3D game (in Web Player). At the end of process $rsa->decrypt() return "false" :-( Server generate RSA keys and send public key to Unity: $rsa = new…
4
votes
1 answer

C# RSA Encrpytion -> Laravel phpseclib decrypt()

I'm using a key pair generated by phpseclib and then I use it to encrypt in C# a message and decrypt in PHP. The public key is: -----BEGIN PUBLIC…
Patrick L.
  • 526
  • 6
  • 24
4
votes
4 answers

Downloading a folder with phpseclib Net_SFTP.get does not work

I am trying to access a file in an SFTP folder server using phpseclib. But when I try using $sftp->get, it returns false. I am not sure how to debug the problem at all. public function get_file_from_ftps_server() { $sftp = new…
Masnad Nihit
  • 1,986
  • 2
  • 21
  • 40
4
votes
1 answer

How to convert phpseclib's CRYPT_RSA_SIGNATURE_PKCS1 to node

How to convert PHP's $rsa->verify function to node? I used the crypto's verify function like this: const crypto = require('crypto'); const verify = crypto.createVerify('RSA-SHA256'); verify.update('some data to sign'); const public_key =…
THpubs
  • 7,804
  • 16
  • 68
  • 143
4
votes
2 answers

SSH connection through proxy PHP

Is it possible to establish ssh connection through proxy using php? My php code is $connection = ssh2_connect('x.x.x.x'); But it gives an error below PHP Warning: ssh2_connect(): Unable to connect to x.x.x.x I can't establish ssh connection via…
Farid Movsumov
  • 12,350
  • 8
  • 71
  • 97
4
votes
4 answers

How do I copy or move remote files with phpseclib?

I've just discovered phpseclib for myself and would like to use it for my bit of code. Somehow I can't find out how I could copy files from one sftp directory into an other sftp directory. Would be great if you could help me out with…
Jan Neuman
  • 57
  • 1
  • 4
4
votes
1 answer

Unable to use phpseclib classes

I've installed the phpseclib library from github and I'm trying to encrypt a password (for steamcommunity) with PHP. I am able to do it with Javascript by using the javascript code Steam has on their website but I cannot encrypt the password using…
Ari Seyhun
  • 11,506
  • 16
  • 62
  • 109
4
votes
1 answer

SSH connect using PHP

I am trying connect to a server via SSH using below code: include('Net/SSH2.php'); $ssh = new Net_SSH2('mydomain.com'); if (!$ssh->login('xxxx', 'xxxx')) { exit('Login Failed'); }else{ echo "connected"; } echo $ssh->exec('pwd'); It…
Shijin TR
  • 7,516
  • 10
  • 55
  • 122
4
votes
1 answer

I can't get phpseclib to work

What I want to do I want to upload/download a file via sftp using php. The phpseclib-library looks very promising. What I already did I changed my conposer.json to: { "require": { "nicolab/php-ftp-client":"*", …
Simon Balling
  • 481
  • 1
  • 5
  • 14
1
2
3
55 56