semvec/pypi-packages huggingface dataset:
owiener 1.0.10
A Python3 implementation of the Wiener attack on RSA
Requires Python: >=3.5

# oWiener
[![Test](https://github.com/orisano/owiener/actions/workflows/test.yml/badge.svg)](https://github.com/orisano/owiener/actions/workflows/test.yml)
[![PyPI version](https://badge.fury.io/py/owiener.svg)](https://badge.fury.io/py/owiener)
[![Python Versions](https://img.shields.io/pypi/pyversions/owiener.svg)](https://pypi.org/project/owiener/)

A Python3 implementation of the Wiener attack on RSA.

## Installation
```bash
python3 -m pip install owiener
```
or
```bash
curl -O https://raw.githubusercontent.com/orisano/owiener/master/owiener.py
```

## Example
```python
import owiener

e = 30749686305802061816334591167284030734478031427751495527922388099381921172620569310945418007467306454160014597828390709770861577479329793948103408489494025272834473555854835044153374978554414416305012267643957838998648651100705446875979573675767605387333733876537528353237076626094553367977134079292593746416875606876735717905892280664538346000950343671655257046364067221469807138232820446015769882472160551840052921930357988334306659120253114790638496480092361951536576427295789429197483597859657977832368912534761100269065509351345050758943674651053419982561094432258103614830448382949765459939698951824447818497599
n = 109966163992903243770643456296093759130737510333736483352345488643432614201030629970207047930115652268531222079508230987041869779760776072105738457123387124961036111210544028669181361694095594938869077306417325203381820822917059651429857093388618818437282624857927551285811542685269229705594166370426152128895901914709902037365652575730201897361139518816164746228733410283595236405985958414491372301878718635708605256444921222945267625853091126691358833453283744166617463257821375566155675868452032401961727814314481343467702299949407935602389342183536222842556906657001984320973035314726867840698884052182976760066141
d = owiener.attack(e, n)

if d is None:
    print("Failed")
else:
    print("Hacked d={}".format(d))
    
# Hacked d=4221909016509078129201801236879446760697885220928506696150646938237440992746683409881141451831939190609743447676525325543963362353923989076199470515758399
```

## References
Cryptanalysis of Short RSA Secret Exponents:  
https://www.cits.ruhr-uni-bochum.de/imperia/md/content/may/krypto2ss08/shortsecretexponents.pdf  
pablocelayes/rsa-wiener-attack:  
https://github.com/pablocelayes/rsa-wiener-attack  
wihoho/Wiener-s-Attack:  
https://github.com/wihoho/Wiener-s-Attack

## Author
Nao Yonashiro (@orisano)

## License
MIT
immoscout-api-client 1.0.0
A thin Python client for the ImmoScout24 mobile API
Requires Python: <4.0,>=3.10
Keywords: api, client, immoscout24

# immoscout-api-client

A thin Python client for the ImmoScout24 mobile API.

## Installation

```bash
pip install immoscout-api-client
```

Or with uv:

```bash
uv add immoscout-api-client
```

## Usage

### Basic Example

```python
import asyncio
from immoscout_api_client import ImmoscoutAPIClient, convert_web_to_mobile

async def main():
    # Initialize the client
    client = ImmoscoutAPIClient()

    # Convert a web URL to mobile API format
    web_url = "https://www.immobilienscout24.de/Suche/de/berlin/berlin/wohnung-mieten"
    mobile_url = convert_web_to_mobile(web_url)

    # Fetch first page of search results
    results = await client.search_list(mobile_url, page=1)
    print(f"Found {results['totalResults']} properties")

    # Get details for a specific property
    listing_id = results['resultListItems'][0]['item']['id']
    details = await client.get_property_details(listing_id)
    print(f"Property title: {details['sections'][0]['title']}")

asyncio.run(main())
```

## API Reference

### `ImmoscoutAPIClient`

Main HTTP client for the ImmoScout24 API.

**Constructor:**

```python
ImmoscoutAPIClient(
    timeout: int = 30,
    impersonate: Impersonate = Impersonate.OkHttp5,
    user_agent: str = "ImmoScout24_1410_30_._"
)
```

**Methods:**

- `async search_list(mobile_url: str, page: int) -> dict`
  - Fetch a page of search results
  - Returns raw JSON response

- `async get_property_details(listing_id: int) -> dict`
  - Fetch detailed information for a specific property
  - Returns raw JSON response

### URL Utilities

- `convert_web_to_mobile(web_url: str) -> str`
  - Convert web URL to mobile API format
  - Raises `ValueError` for invalid URLs or unsupported parameters

- `get_page_url(mobile_url: str, page: int) -> str`
  - Add/update page number in mobile API URL

- `get_expose_details_url(listing_id: int | str) -> str`
  - Construct property details endpoint URL

### Exceptions

- `ImmoscoutAPIError`: Base exception for all API errors
- `ImmoscoutHTTPError`: Raised when HTTP requests fail

## License

MIT License - see LICENSE file for details
fisher-rxc 1.0.1
Fast multithreaded implementation for calculating Fisher's exact test for any RxC sized table
Requires Python: >=3.9

# Fisher RxC

Fast multithreaded implementation of calculating Fisher's exact test for any RxC size table. Written in Rust using [Maturin](https://github.com/PyO3/maturin).

## Installation

```bash
pip install fisher-rxc
```

```python
import fisher
```

## Usage

`fisher.exact(table, workspace=None)`

Calculate Fisher's exact test for 2D list according to Mehta & Patel's Network Algorithm. If workspace size is not provided, it will be "guessed" dynamically.

Workspace size of 2e8 takes at most 800MB of RAM.

`fisher.sim(table, iterations)`

Calculate Fisher's exact test for 2D list by multithreaded Monte Carlo simulation. A modern CPU can quickly do 10^7 iterations and get accurate results.

`fisher.recursive(table)`

> [!WARNING]
> This is experimental and may not work on every CPU platform and generation. Any feedback is appreciated

Calculate Fisher's exact test by a multithreaded SIMD recursive algorithm. Despite extensive optimization efforts, this is still generally **much slower** than the _fisher.exact_ function. Only use for small tables with low numbers.

### Return values

`0 <= x <= 1`: p-value

`x < 0`: error code number, message printed to stdout

## Performance

See [benchmark.py](https://github.com/SakiiCode/fisher/blob/main/benchmark.py)

_AMD Ryzen 5600X running LMDE 7_

```
-- EXACT TEST --
fisher-rxc	0.2631	in 20.04s
rpy2		0.2631	in 20.64s
-----------
fisher-rxc	0.9981	in 4.71s
rpy2		0.9981	in 5.28s
-----------
-- MONTE-CARLO SIMULATION --
fisher-rxc	0.2631	in 0.58s
rpy2		0.2630	in 31.53s
-----------
fisher-rxc	0.9981	in 0.67s
rpy2		0.9981	in 36.75s
-----------
```

## Building

**Windows**

```sh
python3 -m venv .env
.env/Scripts/Activate.ps1
maturin develop --release
```

**Linux**

```sh
python3 -m venv .env
source .env/bin/activate
pip3 install maturin[patchelf]
maturin develop --release
# For benchmarks:
sudo apt install r-base
pip install rpy2
```

## References

Contingency table generator (ASA159): https://people.sc.fsu.edu/~jburkardt/c_src/asa159/asa159.html

Fisher' exact test - network algorithm (ASA643): https://netlib.org/toms/643.gz

Fisher's exact test - recursive: https://stackoverflow.com/questions/25368284/fishers-exact-test-for-bigger-than-2-by-2-contingency-table

Fortran to C transpiler: https://www.netlib.org/f2c/

C to Rust transpiler: https://github.com/immunant/c2rust