PeerPaste lets you copy and paste text between two devices that are present on the same local network (LAN). The data transfer is encrypted, so you can transfer confidential things like passwords via PeerPaste without having to worry about eavesdroppers. The encryption key is transferred by scanning a QR code with the mobile’s camera, so there is no public-key cloud infrastructure involved, or any cloud services at all actually. It’s all peer-to-peer on the local network.
Features:
You can find it on the Google Play Store. It is recommended that you try the free demo version first:
https://play.google.com/store/apps/details?id=com.cuspycode.android.demo.peerpaste
The unrestricted paid version is available here:
https://play.google.com/store/apps/details?id=com.cuspycode.android.peerpaste
Version 2.0 should work on Android 7.0 and later, although I have so far only tested it on Android 13.
The app is not yet available for iOS.
First you need to have Java SE 8 installed on your machine. Later Java versions will likely work too, although so far I have only tested it on Java 11. Then download peerpaste.jar
and the shell script peerpaste
. The shell script is a trivial wrapper that will work on any machine that supports a POSIX shell.
Run the command ./peerpaste
to start the server.
Add “--help
” to get a list of command-line options. See the FAQ section below for some useful options.
Stop the peerpaste server by typing ^C, or terminate it with the kill
command if you are running it in the background.
This is just the generic version packaged as a MacOS app for convenience. To install, just download PeerPaste.zip
and unzip it. The result is a MacOS app that you can move to the Applications folder, or put in the dock, or wherever you want. Java SE is a prerequisite, just like for the generic version.
Frequently Asked Questions, preloaded with a few anticipated questions.
This is most likely caused by network connectivity issues:
Another possibility is that you have an exceptional network configuration that causes the desktop server to pick the wrong IP address to advertise on mDNS, which makes it unavailable to other devices even though they are connected to the same LAN. This can be remedied by following the instructions in the FAQ answer How do I bind the listening port to a different IP address?
Normally you just click on “Settings” and delete the key on the mobile device, and then try again. But sometimes you need to delete the shared key on both devices. The easiest way to do that on the desktop application is to delete the file .local/share/peerpaste/peerpaste-data.json
in your home directory, or if you are comfortable editing JSON files you can delete just the appropriate entry in this file.
One major use case for PeerPaste is to paste passwords or password-reset links or signup confirmation links etc, from one device to another. This of course requires trusting that the app is secure. The encryption and decryption code used in the desktop edition is published here on GitHub. It uses industry standard practices, and it’s open for anyone to audit. The exact same code is used in the Android version, with the exception of a couple of trivial differences in how the Base64
library is invoked due to trivial differences in the Java library versions.
Either your Android version is too old to support the required crypto algorithm (AES-128/GCM), or you live in a country with an evil government that restricts the use of strong cryptography. In either case this means that you cannot run PeerPaste on your Android device, and unfortunately there is nothing I can do about it.
I would like to recover some of my costs for developing and publishing the app. Also, this is an app that I would happily pay for myself if someone else had authored it, so why shouldn’t I expect the same from you?
You can install the free demo app PeerPaste Demo
. If the demo version works on your device, then the real version will also work.
Because I currently have no incentive to do the work involved in publishing the source code for the mobile app. This might change in the future however.
Not yet, but maybe it could happen if there is enough demand to motivate the effort.
The desktop application uses the hostname by default. But the service name can be changed by providing a command-line argument, e.g. --name "Steve's Laptop"
.
On Android the service name depends on whether the “Nearby devices” permission has been enabled or not. If enabled, the Bluetooth device name will be used. Otherwise the service name will be a combination of manufacturer and model name, e.g. “Sony XQ-BT52”. Note: the “Nearby devices” permission is only used to retrieve the Bluetooth device name. Earlier Android API versions did not require any special permission for this, but for some reason the Android maintainers chose to restrict the feature.
This is only possible in the desktop application. You can either provide the IP address explicitly, via e.g. --address 192.0.2.3
, or you can specify the network interface, e.g. --interface eth1
.
You can also specify the port number via e.g. --port 12345
. The default is a random port number picked by the operating system.
This is a known bug in the Xorg/X11 clipboard design. The X clipboard is only a reference to the original data, so when the originating application exits, the reference doesn’t refer to anything anymore. The solution is to either use the clipboard data before exiting peerpaste desktop, or by running a clipboard manager (e.g. xsel
or some other alternative).
By default, the desktop application uses full pixel antialiasing on Linux, which looks fuzzy when compared to the more commonly used subpixel antialiasing. The reason is that Java can’t determine the subpixel arrangement when running on Linux. But you can enable subpixel antialiasing explicitly by providing the command-line argument --aa <VALUE>
where <VALUE>
is one of:
lcd_hrgb
lcd_hbgr
lcd_vrgb
lcd_vbgr
lcd
— same as lcd_hrbg
default
— revert to Java’s default, which may or may not be no antialiasing at all.Try them one at a time until you find one that looks good on your desktop screen.
The desktop application still works when running in headless mode, but you’ll need to add the --show-data
option to show received data, or the --paste <TEXT>
option when sending data.
This is possible to accomplish via the current generic desktop/laptop application, but only if you first add an encryption key via manual editing of ~/.local/share/peerpaste/peerpaste-data.json
on both devices. This may possibly be improved in future versions. However, there is a much simpler solution for this case, if you have SSH access from one machine to the other:
ssh $HOSTNAME pbpaste
— prints the remote MacOS clipboard over an encrypted SSH connection.ssh $HOSTNAME DISPLAY=:0 xsel
— prints the remote X11/UNIX clipboard over an encrypted SSH connection.I don’t use Windows, but I’m sure a similar solution exists there, you’ll just have to find it on your own.